2017년 12월 14일 목요일

ImageNet LSVRC2012 이미지넷 데이터셋 다운받기



Step1: ImageNet 폴더 만들기

~ \$ mkdir ~/Downloads/ImageNet

Step2: Dataset, Bounding boxes 다운받기

<Training set (Task 1 & 2) 138GB>
~/Downloads/ImageNet\$ wget http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_train.tar
~/Downloads/ImageNet\$ wget http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_bbox_train_v2.tar.gz

<Validation set 6.3GB>
~/Downloads/ImageNet\$ wget http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_val.tar
~/Downloads/ImageNet\$ wget http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_bbox_val_v3.tgz


Step3: 압축풀기

~/Downloads/ImageNet\$ mkdir image
~/Downloads/ImageNet\$ mv ILSVRC2012_img_train.tar image
~/Downloads/ImageNet\$ mv ILSVRC2012_img_val.tar image
~/Downloads/ImageNet\$ cd image

<Training set >
~/Downloads/ImageNet/Data\$ mkdir train
~/Downloads/ImageNet/Data\$ mv ILSVRC2012_img_train.tar train
~/Downloads/ImageNet/Data\$ cd train
~/Downloads/ImageNet/Data/train\$ tar xf ILSVRC2012_img_train.tar
~/Downloads/ImageNet/Data/train\$ find . -name "*.tar" | while read NAME ; do mkdir -p "\${NAME%.tar}"; tar -xvf "\${NAME}" -C "\${NAME%.tar}"; rm -f "\${NAME}"; done

<Validation set >
~/Downloads/ImageNet/Data/train\$ cd ..
~/Downloads/ImageNet/Data\$ mkdir val
~/Downloads/ImageNet/Data\$ mv ILSVRC2012_img_train.val val
~/Downloads/ImageNet/Data\$ cd val
~/Downloads/ImageNet/Data/val\$ tar xf ILSVRC2012_img_val.tar

<Bounding boxes >
~/Downloads/ImageNet\$ mkdir Annotations
~/Downloads/ImageNet\$ mv ILSVRC2012_bbox_train_v2.tar.gz bbox
~/Downloads/ImageNet\$ mv ILSVRC2012_bbox_val_v3.tgz bbox
~/Downloads/ImageNet\$ cd Annotations
~/Downloads/ImageNet/Annotations\$ tar xzf ILSVRC2012_bbox_val_v3.tgz
~/Downloads/ImageNet/Annotations\$ mkdir train
~/Downloads/ImageNet/Annotations\$ mv ILSVRC2012_bbox_train_v2.tar.gz train
~/Downloads/ImageNet/Annotations\$ cd train
~/Downloads/ImageNet/Annotations/train\$ tar xzf ILSVRC2012_bbox_train_v2.tar.gz

Folder structure

Downloads
└── ImageNet
    ├── Data
    |   ├── train
    |   |   ├── n01728572 # class1
    |   |   |   ├── n01728572_10.JPEG
    |   |   |   ├── ...
    |   |   |   └── n01728572_29824.JPEG
    |   |   ├── ...
    |   |   └── n15075141 # class1000
    |   └── val
    |       ├── ILSVRC2012_val_00000001.JPEG
    |       ├── ...
    |       └── ILSVRC2012_val_00050000.JPEG
    └── Annotations
        ├── train
        |   ├── n01728572 # class1
        |   |   ├── n01728572_10.xml
        |   |   ├── ...
        |   |   └── n01728572_29824.xml
        |   ├── ...
        |   └── n15075141 # class1000
        └── val
            ├── ILSVRC2012_val_00000001.xml
            ├── ...
            └── ILSVRC2012_val_00050000.xml