Convert Cityscapes
to Supervisely
Converting Cityscapes to Supervisely brings your labels into a format that keeps every shape, tag and class, ready to review, relabel and export to any other format.
Cityscapes vs Supervisely
Cityscapes, the format of the urban street-scene benchmark, stores the polygons of each image in a _gtFine_polygons.json file next to its _leftImg8bit image.
| Cityscapes | Supervisely | |
|---|---|---|
| Annotation files | One _gtFine_polygons.json per image, next to the _leftImg8bit image, in split and city folders. | One JSON file per image (ann/<image>.json) in each dataset folder, and one meta.json for the project. |
| Coordinates | Absolute pixels; every object is a polygon point list. | Absolute pixels; a rectangle is stored as its top-left and bottom-right points. |
| Shapes | Polygons (the fine annotations, gtFine). | Rectangles, polygons, polylines, points, bitmap masks, keypoint graphs, alpha masks and 2D cuboids. |
| Classes | Each object carries a label name; class_to_id.json gives custom classes their ids and colours. | Classes are defined in meta.json with a name, a shape and a colour; tags can sit on images and on objects. |
What the conversion changes
Import Cityscapes
- Images need the _leftImg8bit suffix and annotation files the _gtFine_polygons.json one.
- Images are tagged train, val or test after the folders they come from.
Export to Supervisely
- Every imported label keeps its shape, class and tags in Supervisely JSON.
Convert Cityscapes to Supervisely in three steps
- 01
Import Cityscapes
Upload your Cityscapes folder or archive to Supervisely and run Import Cityscapes from the Ecosystem: it creates a project with the images and labels (Cityscapes import guide).
- 02
Review in the labeling toolbox
Open the project in the image labeling toolbox to check classes and fix labels.
- 03
Export to Supervisely
Open the menu of the project, choose Download via app and run Export to Supervisely format. The archive appears in Tasks and Team Files.
Apps in the Supervisely Ecosystem
Run this conversion on your own data in a free account, or let us walk your team through it.
Or in a few lines of Python
After the import, the Python SDK downloads the project as Supervisely JSON, the format the Export to Supervisely format app writes.
Install it with pip install supervisely.
import supervisely as sly
# SERVER_ADDRESS and API_TOKEN come from the environment
api = sly.Api.from_env()
# ID of the project Import Cityscapes created
sly.download_fast(api, project_id=12345, dest_dir="sly_project")Frequently asked questions.
Can I convert Cityscapes to Supervisely without code?
Yes. Import the data with Import Cityscapes, check it in the image labeling toolbox, then export it with Export to Supervisely format. Both start from the Supervisely web interface.
What changes when Cityscapes becomes Supervisely?
Images need the _leftImg8bit suffix and annotation files the _gtFine_polygons.json one. Images are tagged train, val or test after the folders they come from. Every imported label keeps its shape, class and tags in Supervisely JSON.
Does Supervisely use the same coordinates as Cityscapes?
Both use absolute pixel coordinates, written differently. Cityscapes: Absolute pixels; every object is a polygon point list. Supervisely: Absolute pixels; a rectangle is stored as its top-left and bottom-right points.
How do Cityscapes classes carry over to Supervisely?
In Cityscapes: each object carries a label name; class_to_id.json gives custom classes their ids and colours. In Supervisely: classes are defined in meta.json with a name, a shape and a colour; tags can sit on images and on objects. The class names stay the same on the way through Supervisely, so rename or merge classes in the project before you export.
Can I convert Cityscapes to Supervisely in Python?
After the import, the Python SDK downloads the project as Supervisely JSON, the format the Export to Supervisely format app writes. See the SDK export tutorial.