Download and preprocess datasets before you run experiments.
Here, we provide three examples: ImageNet (ILSVRC 2012), COCO 2017, and PASCAL VOC 2012.
As the terms of use do not allow to distribute the URLs, you will have to create an account here to get the URLs, and replace ${TRAIN_DATASET_URL}
and ${VAL_DATASET_URL}
with them.
wget ${TRAIN_DATASET_URL} ./
wget ${VAL_DATASET_URL} ./
# Go to the root of this repository
mkdir ~/datasets/ilsvrc2012/{train,val} -p
mv ILSVRC2012_img_train.tar ~/datasets/ilsvrc2012/train/
mv ILSVRC2012_img_val.tar ~/datasets/ilsvrc2012/val/
cd ~/datasets/ilsvrc2012/train/
tar -xvf ILSVRC2012_img_train.tar
mv ILSVRC2012_img_train.tar ../
for f in *.tar; do
d=`basename $f .tar`
mkdir $d
(cd $d && tar xf ../$f)
done
rm -r *.tar
cd ../../../../
wget https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh
mv valprep.sh ~/datasets/ilsvrc2012/val/
cd ~/datasets/ilsvrc2012/val/
tar -xvf ILSVRC2012_img_val.tar
mv ILSVRC2012_img_val.tar ../
sh valprep.sh
mv valprep.sh ../
cd ../../../../
wget http://images.cocodataset.org/zips/train2017.zip ./
wget http://images.cocodataset.org/zips/val2017.zip ./
wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip ./
# Go to the root of this repository
mkdir ~/datasets/coco2017/ -p
mv train2017.zip ~/datasets/coco2017/
mv val2017.zip ~/datasets/coco2017/
mv annotations_trainval2017.zip ~/datasets/coco2017/
cd ~/datasets/coco2017/
unzip train2017.zip
unzip val2017.zip
unzip annotations_trainval2017.zip
cd ../../../
You can skip Steps 3.1 and 3.2 by replacing download: False
in a yaml config file with download: True
.
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
# Go to the root of this repository
mkdir ~/datasets/ -p
mv VOCtrainval_11-May-2012.tar ~/datasets/
cd ~/datasets/
tar -xvf ILSVRC2012_img_val.tar
cd ../../