Cityscapes
Overview
This converter allows to import images with .json
annotations in Cityscapes format.
โ ๏ธ Note: images must have suffix _leftImg8bit
and annotations suffix _gtFine_polygons
and .json
extension. Check the example of the file structure below.

Enterprise users have access to "Import as links" option, which supports import of this format with annotations. This option might be beneficial in many cases, as it allows data import to Supervisely platform without re-uploading, maintaining a single source and speeding up import process.
To step up import speed even further you can compress all annotation files (.json
's) into an archive and import it together with the images. (Note: This method is format-dependent and may not apply to all formats.)
Format description
Supported image formats: .jpg
, .jpeg
, .mpo
, .bmp
, .png
, .webp
, .tiff
, .tif
, .jfif
, .avif
, .heic
, and .heif
With annotations: yes
Supported annotation file extension: .json
.
Grouped by: any structure (uploaded to a single dataset)\
Input files structure
Example data: download โฌ๏ธ\
Recommended directory structure:
๐ฆproject name
โฃ ๐gtFine
โ โฃ ๐test
โ โ โ ๐ds1
โ โ โ โ ๐IMG_8144_gtFine_polygons.json
โ โฃ ๐train
โ โ โ ๐ds1
โ โ โ โฃ ๐IMG_1836_gtFine_polygons.json
โ โ โ โฃ ๐IMG_2084_gtFine_polygons.json
โ โ โ โฃ ๐IMG_3861_gtFine_polygons.json
โ โ โ โ ๐IMG_4451_gtFine_polygons.json
โ โ ๐val
โ โ โ ๐ds1
โ โ โ โ ๐IMG_0748_gtFine_polygons.json
โฃ ๐leftImg8bit
โ โฃ ๐test
โ โ โ ๐ds1
โ โ โ โ ๐ผ๏ธIMG_8144_leftImg8bit.png
โ โฃ ๐train
โ โ โ ๐ds1
โ โ โ โฃ ๐ผ๏ธIMG_1836_leftImg8bit.png
โ โ โ โฃ ๐ผ๏ธIMG_2084_leftImg8bit.png
โ โ โ โฃ ๐ผ๏ธIMG_3861_leftImg8bit.png
โ โ โ โ ๐ผ๏ธIMG_4451_leftImg8bit.png
โ โ ๐val
โ โ โ ๐ds1
โ โ โ โ ๐ผ๏ธIMG_0748_leftImg8bit.png
โ ๐class_to_id.json
Format Config File
In order to import custom annotations for the images, you need to provide a class_to_id.json
file. This file should contain a list with dictionaries. Each dictionary should contain information about the class with the following fields:
name
- the name of the class. It should be unique.id
- the ID of the class. From 1 to N-1, where N is the number of classes.color
- the color of the class in RGB format. If not specified, the color will be generated randomly
Single-Image Annotation JSON
Annotation file should contain the following fields:
imgHeight
- the height of the imageimgWidth
- the width of the imageobjects
- a list of dictionaries, each containing information about the objectlabel
- the name of the classpolygon
- a list of points that form the polygon of the object
Example of the annotation file from provided sample data:
Useful links
Last updated
Was this helpful?