Skip to content
Snippets Groups Projects
Commit 1f60f546 authored by Ross Girshick's avatar Ross Girshick
Browse files

shuffle where data are stored

parent dbd427b3
Branches
No related tags found
No related merge requests found
selective_search_data*
imagenet_models*
fast_rcnn_models*
VOCdevkit*
cache
This directory holds:
- Precomputed object proposals
- Caffe models pretrained on ImageNet
- Fast R-CNN models
- Symlinks to datasets
To download precomputed selective search proposals, run:
```
./tools/scripts/fetch_selective_search_data.sh
```
This script will populate `data/selective_search_data`.
To download Caffe models pretrained on ImageNet, run:
```
./tools/scripts/fetch_imagenet_models.sh
```
This script will populate `data/imagenet_models`.
To download Fast R-CNN models, run:
```
./tools/scripts/fetch_fast_rcnn_models.sh
```
This script will populate `data/fast_rcnn_models`.
In order to train and test with PASCAL VOC, you will need to establish symlinks.
From the `data` directory (`cd data`):
```
# For VOC 2007
ln -s /your/path/to/VOC2007/VOCdevkit VOCdevkit2007
# For VOC 2012
ln -s /your/path/to/VOC2012/VOCdevkit VOCdevkit2012
```
Since you'll likely be experimenting with multiple installs of Fast R-CNN in
parallel, you'll probably want to keep all of this data in a shared place and
use symlinks. On my system I create the following symlinks inside `data`:
```
# data/cache holds various outputs created by the datasets package
ln -s /data/fast_rcnn_shared/cache
# move the imagenet_models to shared location and symlink to them
ln -s /data/fast_rcnn_shared/imagenet_models
# move the selective search data to a shared location and symlink to them
ln -s /data/fast_rcnn_shared/selective_search_data
ln -s /data/VOC2007/VOCdevkit VOCdevkit2007
ln -s /data/VOC2012/VOCdevkit VOCdevkit2012
```
......@@ -62,7 +62,7 @@ class imdb(object):
def cache_path(self):
return os.path.abspath(os.path.join(
os.path.dirname(__file__),
'cache'))
'..', 'data', 'cache'))
@property
def num_images(self):
......
......@@ -81,7 +81,7 @@ class pascal_voc(datasets.imdb):
"""
path = os.path.abspath(os.path.join(
os.path.dirname(__file__),
'..', 'datasets', 'VOCdevkit' + self._year))
'..', 'data', 'VOCdevkit' + self._year))
return path
def gt_roidb(self):
......@@ -142,10 +142,11 @@ class pascal_voc(datasets.imdb):
return a
def _load_selective_search_roidb(self, gt_roidb):
filename = os.path.join(self.cache_path, 'selective_search_data',
self.name + '.mat')
filename = os.path.abspath(os.path.join(self.cache_path, '..',
'selective_search_data',
self.name + '.mat'))
assert os.path.exists(filename), \
'Selective search data not found at: {}'.format(filename)
'Selective search data not found at: {}'.format(filename)
raw_data = sio.loadmat(filename)
num_images = raw_data['boxes'].ravel().shape[0]
......
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../data" && pwd )"
cd $DIR
FILE=imagenet_models.tgz
URL=https://www.dropbox.com/s/22it3se7e4zi2mi/imagenet_models.tgz?dl=0
CHECKSUM=66dbfdf04297e1e68b49f168a2ccc59d
if [ -f $FILE ]; then
echo "File already exists. Checking md5..."
os=`uname -s`
if [ "$os" = "Linux" ]; then
checksum=`md5sum $FILE | awk '{ print $1 }'`
elif [ "$os" = "Darwin" ]; then
checksum=`cat $FILE | md5`
fi
if [ "$checksum" = "$CHECKSUM" ]; then
echo "Checksum is correct. No need to download."
exit 0
else
echo "Checksum is incorrect. Need to download again."
fi
fi
echo "Downloading pretrained ImageNet models (1G)..."
wget $URL -O $FILE
echo "Unzipping..."
tar zxvf $FILE
echo "Done. Please run this command again to verify that checksum = $CHECKSUM."
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../data" && pwd )"
cd $DIR
FILE=selective_search_data.tgz
URL=https://www.dropbox.com/s/g1z7iolrtxdo56c/selective_search_data.tgz?dl=0
CHECKSUM=7cc85568609e1ac645f102c37eb376c3
if [ -f $FILE ]; then
echo "File already exists. Checking md5..."
os=`uname -s`
if [ "$os" = "Linux" ]; then
checksum=`md5sum $FILE | awk '{ print $1 }'`
elif [ "$os" = "Darwin" ]; then
checksum=`cat $FILE | md5`
fi
if [ "$checksum" = "$CHECKSUM" ]; then
echo "Checksum is correct. No need to download."
exit 0
else
echo "Checksum is incorrect. Need to download again."
fi
fi
echo "Downloading precomputed selective search boxes (1.8G)..."
wget $URL -O $FILE
echo "Unzipping..."
tar zxvf $FILE
echo "Done. Please run this command again to verify that checksum = $CHECKSUM."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment