What makes a "class"?
Doodler
segments images into "classes" that are discrete labels that you define to represent and reduce the dimensionality of features and objects in your imagery.
Each class really represents a spectrum of textures, colors, and spatial extents. It can be difficult to define a good set, but the golden rule (in my humble opinion) is that each class in the set of classes should represent a spectrum of image features that collectively have much greater inter-class variability than intra-class variability.
That can be difficult to define in practice with generality, but here's a tip: imagine a really low- (coarse-) resolution version of your image (or make one!) and ask yourself, "are there are two sets of features that could be easily misconstrued as being in the same class, but are in fact two separate classes?" If the answer in yes, ideally you should lump those classes into a merged class. If your intended outcome dictates that's not possible to do, ask yourself if the two classes could be broken up further, say into 3 or 4 classes, to change your answer to the above question?
In general, doodler
is optimized for classes that are relatively large (in terms of contiguous spatial extent) and distinct from one another. See examples in the gallery and elsewhere on this website. However, you can change that behavior by modifying the values of the hyperparameters theta_col
and compat_col
in your config file. Also, note that the CRF inferences are averaged using weights based on the relative frequency of the classes in your contributed doodles.
You can have any number of classes (well, 2 or more, with the two classes case styled as something
and other
) but note that increasing the number of classes also increases the amount of time it takes to interact with the program, since each class must be either labelled or actively skipped.
Be prepared to experiment with classes - how well do they work on a small subset of your imagery? Look at the unusual images in your set and and decide if there is a class there you hadn't previously thought of. If you can't decide whether to lump or split certain classes or sets of classes, make separate config files with the different class lists, doodle
using the first config file, then run doodle
again by passing it the other config file(s) with the npy
file you generated on the first go, using the -f
flag.
So, the full workflow:
python doodler.py -c config1.json
(config1.json
has the first set of classes)
then move your outputs in data/label_images
, except the .npy file(s), to another folder, and run doodler
again, this time with a different config file and the npy file
python doodler.py -c config2.json -f data/label_image/my_npy_file.npy
(config2.json
has the second set of classes)
and repeat through all your config files with different sets of classes.