Create a your-folder/datasets
directory.
- Download CUB dataset and unzip it in
your-folder/datasets
. - Download annotations from U-CMR using this link and unzip them in
your-folder/datasets
.
At the end you should obtain a your-folder/datasets
directory organized as follows:
.
├── CUB_200_2011/ # CUB original dataset
└── UCMR_CUB_data/ # U-CMR annotations
- Follow option A) or B) to have preprocessed data of Pascal3D+.
- Download annotations of car class from U-CMR using this link and unzip them in
your-folder/datasets
. These data are used when testing on the car class to reproduce results of Table 2 in the paper.
To obtain the already preprocessed data, please send an email to Alessandro Simoni stating:
- Your name, title and affiliation
- Your intended use of the data
Install Detectron2 (v0.3) in your environment running this line:
python -m pip install detectron2==0.3 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.5/index.html
- Create
PASCAL3D+
directory inyour-folder/datasets
. - Create
PASCAL3D+/images
directory inyour-folder/datasets
. - Download and unzip the Pascal3D+ dataset.
- Copy and paste the content of
Images
folder of the unzipped dataset inyour-folder/datasets/PASCAL3D+/images
. - Copy and paste
PASCAL/VOCdevkit/VOC2012/SegmentationClass
folder of the unzipped dataset inyour-folder/datasets/PASCAL3D+
. - Copy and paste
PASCAL/VOCdevkit/VOC2012/SegmentationObject
folder of the unzipped dataset inyour-folder/datasets/PASCAL3D+
. - Download the annotations/masks folder and unzip it into
your-folder/datasets/PASCAL3D+
.
At the end you should obtain a your-folder/datasets/PASCAL3D+
directory organized as follows:
.
├── annotations/ # folder with txt annotation files
├── images/ # folder with Imagenet/PascalVOC image folders
│ ├── aeroplane_imagenet/
│ │ ├── first_image.jpg
│ │ ├── ...
│ │ └── last_image.jpg
│ ├── aeroplane_pascal/
│ ├── ...
│ ├── tvmonitor_imagenet/
│ └── tvmonitor_pascal/
├── masks_cmr/ # folder with CMR masks
│ ├── aeroplane.mat
│ ├── ...
│ └── tvmonitor.mat
├── masks_hariharan/ # folder with Hariharan masks
│ ├── 1
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── ...
│ └── 20
├── SegmetationClass/ # folder with segmentation class masks for PascalVOC
│ │ ├── first_image.jpg
│ │ ├── ...
│ │ └── last_image.jpg
├── SegmentationObject/ # folder with segmentation object masks for PascalVOC
│ │ ├── first_image.jpg
│ │ ├── ...
│ │ └── last_image.jpg
├── aeroplane_val.txt
├── bicycle_val.txt
├── boat_val.txt
├── bottle_val.txt
├── bus_val.txt
├── car_val.txt
├── chair_val.txt
├── diningtable_val.txt
├── motorbike_val.txt
├── sofa_val.txt
├── train_val.txt
├── tvmonitor_val.txt
├── VOC_classes.txt
└── VOC_mask_colors_RGB.txt
Run the preprocessing scripts as follows:
python datasets/pascal3d/preprocess.py --dataset_dir your-folder/datasets/PASCAL3D+ --results_dir your-folder/datasets/PASCAL_final
python datasets/pascal3d/split_train_val_test_VOC.py --orig_dataset_dir your-folder/datasets/PASCAL3D+ --new_dataset_dir your-folder/datasets/PASCAL_final
At the end you should obtain a your-folder/datasets/PASCAL_final
directory organized as follows:
.
├── aeroplane/ # class folder
│ ├── annotations/ # class annotations folder
│ │ ├── first_annot.yaml
│ │ ├── ...
│ │ └── last_annot.yaml
│ ├── images/
│ │ ├── first_image.jpg
│ │ ├── ...
│ │ └── last_image.jpg
│ ├── masks/
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── masks_cmr/
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── masks_hariharan/
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── masks_pointrend/
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── masks_VOC/
│ │ ├── first_mask.png
│ │ ├── ...
│ │ └── last_mask.png
│ ├── aeroplane_eval.txt
│ ├── aeroplane_test.txt
│ └── aeroplane_train.txt
├── bicycle/
├── boat/
├── bottle/
├── bus/
├── car/
├── chair/
├── diningtable/
├── motorbike/
├── sofa/
├── train/
└── tvmonitor/