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.

datadings.sets.Places2017_write.array_to_image(array, format, dtype, mode, **kwargs)[source]
datadings.sets.Places2017_write.array_to_png(array)[source]
datadings.sets.Places2017_write.create_color_map(files, outdir)[source]
datadings.sets.Places2017_write.create_counts(files, outdir)[source]
datadings.sets.Places2017_write.extract_boundary(boundarytar, name)[source]
datadings.sets.Places2017_write.extract_class(classtar, name)[source]
datadings.sets.Places2017_write.extract_instance(instancetar, name)[source]
datadings.sets.Places2017_write.extract_scene(scenes, name)[source]
datadings.sets.Places2017_write.extract_scenelabels(files, outdir)[source]
datadings.sets.Places2017_write.find_sets(tarfp)[source]
datadings.sets.Places2017_write.main()[source]
datadings.sets.Places2017_write.print_classes(files)[source]
datadings.sets.Places2017_write.write_set(imagetar, classtar, instancetar, boundarytar, outdir, name, members, scenes, overwrite)[source]
datadings.sets.Places2017_write.write_sets(files, outdir, args)[source]