Skip to main content

Utility scripts

Doodler is compatible with the segmentation program, Zoo in a few of different ways.

Scenario 1 (most common)#

You wish to generate labels and images for subsequent use in Zoo, specifically to make a dataset to train or test an image segmentation model

run the function gen_images_and_labels_4_zoo.py

This will generate 4 folders, 1 for each of the output types

  1. images:

    The images you doodled

  1. labels

    The color and greyscale label images

and greyscale

  1. doodles

    The image with the color doodles as a semi-transparent overlay

  1. overlays

    The image with the color label as a semi-transparent overlay

Scenario 2#

You wish to use the labels and images in Zoo, but wish to bypass running the Zoo program `make_datasets.py', i.e. you'd like to pass the original labels and images to the model training rather than create augmented outputs of a certain size

run the function gen_npz_4_zoo.py to create npz files that contain only image and label pairs.

Scenario 3#

You wish to know more details about how Doodler arrived at the solution, perhaps for troubleshooting purposes

plot_label_generation.py that generates a detailed sequence of plots for every input npz file

For example, this figure shows the intermediate MLP output

that you may wish to compare to the final CRF output (in this example they are almost identical)

this figure shows the sequence of filters applied to the MLP output and how that gets 'inpainted' by the CRF

this figure shows the first and last set of five extracted features from the input image

Scenario 4#

You simply want to see what's inside a folder of npz files:

*> viz_npz.py creates transparent overlay plots of images and labels, and has three modes with the following syntax viz_npz.py [-t npz type {0}/1/2] where optional -t controls what type of npz file: native from doodler (option 0, default), a labelgen file from plot_label_generation.npz, a npz file used as input for Zoo