datadings.sets.Places2017_write module
- usage: Places2017_write.py [-h] [-o PATH] [-y] [-s] [–shuffle {yes,no}]
[–class-counts] [–color-map] [–classes] [–scenelabels] INDIR
Create Places2017 data set files.
This tool will look for all or parts of the following files in the input directory, depending on the given command, and download them if necessary:
images.tar
sceneparsing.tar
annotations_instance.tar
boundaries.tar
objectInfo150.txt
color150.mat
Additionally, ADE20K_2016_07_26.zip from the ADE20k dataset is required
to extract scene labels with the --scenelabels
option.
Warning
OpenCV 2.4+ is required to create this dataset. If you are unsure how to install OpenCV you can use pip:
pip install opencv-python
Important
Samples have the following keys:
"key"
"image"
"label"
"label_image"
"instance_image"
"boundary"
Positional arguments
INDIR Directory that contains dataset source files.
- options:
- -h, --help
show this help message and exit
- -o PATH, --outdir PATH
Output directory. Defaults to indir.
- -y, --no-confirm
Don’t require user interaction.
- -s, --skip-verification
Skip verification of source files.
–shuffle {yes,no} Write samples in random order. (default: yes) –class-counts Count pixels per class and write to
Places2017_counts.json.
- --color-map
Create color map and write to Places2017_colors.json.
- --classes
Print the class list.
- --scenelabels
Extract the scene labels from ADE20k dataset and write to Places2017_scenelabels.json. This will look for ADE20K_2016_07_26.zip in indir and download if necessary.