Skip to content

Commit

Permalink
update scripts; create cache dir if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgirshick committed Apr 29, 2015
1 parent c5d213d commit d9c54f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/scripts/fetch_fast_rcnn_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
cd $DIR

FILE=fast_rcnn_models.tgz
URL=http://www.cs.berkeley.edu/~rbg/fast-rcnn-data/fast_rcnn_models.tgz
URL=http://www.cs.berkeley.edu/~rbg/fast-rcnn-data/$FILE
CHECKSUM=5f7dde9f5376e18c8e065338cc5df3f7

if [ -f $FILE ]; then
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/fetch_imagenet_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
cd $DIR

FILE=imagenet_models.tgz
URL=http://www.cs.berkeley.edu/~rbg/fast-rcnn-data/imagenet_models.tgz
URL=http://www.cs.berkeley.edu/~rbg/fast-rcnn-data/$FILE
CHECKSUM=8b1d4b9da0593fc70ef403284f810adc

if [ -f $FILE ]; then
Expand Down
6 changes: 3 additions & 3 deletions data/scripts/fetch_selective_search_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
cd $DIR

FILE=selective_search_data.tgz
URL=http://www.cs.berkeley.edu/~rbg/r-cnn-release1-selective-search.tgz
CHECKSUM=6cf6df219c1e514f64482f11d00bd0b4
URL=http://www.cs.berkeley.edu/~rbg/fast-rcnn-data/$FILE
CHECKSUM=7078c1db87a7851b31966b96774cd9b9

if [ -f $FILE ]; then
echo "File already exists. Checking md5..."
Expand All @@ -23,7 +23,7 @@ if [ -f $FILE ]; then
fi
fi

echo "Downloading precomputed selective search boxes (1.8G)..."
echo "Downloading precomputed selective search boxes (0.5G)..."

wget $URL -O $FILE

Expand Down
6 changes: 5 additions & 1 deletion lib/datasets/imdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# --------------------------------------------------------

import os
import os.path as osp
import PIL
from utils.cython_bbox import bbox_overlaps
import numpy as np
Expand Down Expand Up @@ -64,7 +65,10 @@ def roidb(self):

@property
def cache_path(self):
return os.path.join(datasets.ROOT_DIR, 'data', 'cache')
cache_path = osp.abspath(osp.join(datasets.ROOT_DIR, 'data', 'cache'))
if not os.path.exists(cache_path):
os.makedirs(cache_path)
return cache_path

@property
def num_images(self):
Expand Down

0 comments on commit d9c54f8

Please sign in to comment.