Skip to content

Latest commit

 

History

History
86 lines (53 loc) · 2.12 KB

File metadata and controls

86 lines (53 loc) · 2.12 KB

Prepare dataset

# Go to {code_root}/dataset/Pascal3D
cd  dataset/Pascal3D

1) Download datasets.

Get Pascal3D+ dataset.

Download Pascal3D+ from this webpage. Since we only need image data and annotations, you can choose this one release1.1 ~ 7.5GB.

mkdir download.cache

wget ftp://cs.stanford.edu/cs/cvgl/PASCAL3D+_release1.1.zip  -P download.cache/
# unzip
cd download.cache/
unzip PASCAL3D+_release1.1.zip
cd ..

Get the synthetic data from "Render for CNN".

wget https://shapenet.cs.stanford.edu/media/syn_images_cropped_bkg_overlaid.tar  -P download.cache/
# untar
cd  download.cache/
tar xvf syn_images_cropped_bkg_overlaid.tar
cd  ..

Adjust your configuration paths at:

# config.yml
Pascal3D_release_root  : ../download.cache/PASCAL3D+_release1.1  
Synthetic_Images_root  : ../download.cache/syn_images_cropped_bkg_overlaid

2) Build up python datebase for Pascal3D+.

Run

cd    prepare_data
bash  prepare_Pascal3D.sh
  • This script will first call python mat2py.py to dump matlab annotation '.mat' (from Pascal3D+) to python pickle '.pkl'.
  • Then, prepare_anno_db.py will build up python annotation db table with data struture specified as following.
  • Create lmdb for image data storage by python build_imdb.py.

The data structure for annotation record.

obj_id. We assign per instance (a.k.a object) across the images with an object identifier, with the format {image_id}_{x1},{y1},{x2},{y2} where the (x1,y1,x2,y2) is the bounding box annotation on original images.

object_anno (a.k.a rcobj) is a data structure stores the annotation per object. The visualization of such data structure is as following:

use_case

The python definition is implemented in Pascal3D/anno_db_v2/db_type.py

3) Build up python datebase for synthetic data.

bash prepare_r4cnn.sh

This will

  • build up lmdb for synthetic image storage.
  • build up annotation db.