The dataset can be found on the official website if you are affiliated with a research organization. It is also available on Academic torrents.
This script extracts all the images and group them so that folders contain images that belong to the same class.
- Download the
ILSVRC2012_img_train.tar
andILSVRC2012_img_val.tar
- Download the script
wget https://gist.githubusercontent.com/antoinebrl/7d00d5cb6c95ef194c737392ef7e476a/raw/dc53ad5fcb69dcde2b3e0b9d6f8f99d000ead696/prepare.sh
- Run it
./prepare.sh
- If the files are not in the same folder you can specify their paths
./prepare.sh ~/Dataset/imagenet/ILSVRC2012_img_train.tar ~/Dataset/imagenet/ILSVRC2012_img_val.tar
The folder should have the following content:
train/
├── n01440764
│ ├── n01440764_10026.JPEG
│ ├── n01440764_10027.JPEG
│ ├── n01440764_10029.JPEG
│ └── ...
├── n01443537
│ ├── n01443537_10007.JPEG
│ ├── n01443537_10014.JPEG
│ ├── n01443537_10025.JPEG
│ └── ...
├── ...
└── ...
val/
├── n01440764
│ ├── ILSVRC2012_val_00000946.JPEG
│ ├── ILSVRC2012_val_00001684.JPEG
│ └── ...
├── n01443537
│ ├── ILSVRC2012_val_00001269.JPEG
│ ├── ILSVRC2012_val_00002327.JPEG
│ ├── ILSVRC2012_val_00003510.JPEG
│ └── ...
├── ...
└── ...
Thanks for sharing this, really helps me a lot. Just for supplementation, one can use
wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_train.tar --no-check-certificate
andwget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar --no-check-certificate
to download the dataset files.