Common Semantic Segmentation#

Format specification#

CSS format specification is available here.

Supported annotation types:

  • Masks

CSS dataset directory should have the following structure:

└─ Dataset/
    ├── dataset_meta.json # a list of labels
    ├── images/
    │   ├── <img1>.png
    │   ├── <img2>.png
    │   └── ...
    └── masks/
        ├── <img1>.png
        ├── <img2>.png
        └── ...

To describe classes and colors, you should use dataset_meta.json.

Convert to other formats#

Datumaro can convert a CSS dataset into any other format Datumaro supports. To get the expected result, convert the dataset to formats that support the segmentation task (e.g. PASCAL VOC, CamVid, Cityscapes, etc.)

There are several ways to convert a CSS dataset to other dataset formats using CLI:

datum convert -if common_semantic_segmentation -i <path/to/dataset> \
    -f cityscapes -o <output/dir> -- --save-media

Or, using Python API:

import datumaro as dm

dataset = dm.Dataset.import_from('<path/to/dataset>', 'common_semantic_segmentation')
dataset.export('save_dir', 'camvid', save_media=True)

Examples#

Examples of using this format from the code can be found in the format tests