Convert Supervisely
to Pascal VOC

Exporting a Supervisely project to Pascal VOC gets your labels into the format that classic detection tools and the torchvision VOC loaders read.

Format differences

Supervisely vs Pascal VOC

Pascal VOC, the format of the PASCAL Visual Object Classes challenge, stores the boxes of every image in an XML file and segmentation as PNG masks, one for classes and one for instances. A Supervisely project holds every shape the platform can draw, so the conversion is about what Pascal VOC can hold.

SuperviselyPascal VOC
Annotation filesOne JSON file per image (ann/<image>.json) in each dataset folder, and one meta.json for the project.One XML file per image in Annotations/, PNG masks in SegmentationClass/ and SegmentationObject/, image lists in ImageSets/.
CoordinatesAbsolute pixels; a rectangle is stored as its top-left and bottom-right points.Absolute pixels; a box is xmin, ymin, xmax, ymax.
ShapesRectangles, polygons, polylines, points, bitmap masks, keypoint graphs, alpha masks and 2D cuboids.Boxes in the XML; semantic and instance segmentation as PNG masks.
ClassesClasses are defined in meta.json with a name, a shape and a colour; tags can sit on images and on objects.The class name is written in each XML object; colors.txt, added by Supervisely, maps classes to mask colours.

What the conversion changes

Export to Pascal VOC

  • Polygons, bitmaps and rectangles are exported, other shapes are skipped; only polygons and bitmaps are drawn into the masks.
  • Image tags other than train and val are dropped.
  • Without train and val tags the images are split 80/20.
Workflow

Convert Supervisely to Pascal VOC in three steps

  1. 01

    Import Supervisely

    Upload the project folder or archive to Supervisely and run Import images in Supervisely format from the Ecosystem: it creates a project with the images and labels (Supervisely import guide).

  2. 02

    Review in the labeling toolbox

    Open the project in the image labeling toolbox to check classes and fix labels before they go to Pascal VOC.

  3. 03

    Export to Pascal VOC

    Open the menu of the project, choose Download via app and run Export to Pascal VOC. The archive appears in Tasks and Team Files.

Run this conversion on your own data in a free account, or let us walk your team through it.

Python SDK

Or in a few lines of Python

The Python SDK writes Pascal VOC from a Supervisely project on your disk, with no server involved. A project on the platform is downloaded first with sly.download_fast.

Install it with pip install supervisely.

SDK export tutorial
convert.py
import supervisely as sly

# A Supervisely project on disk: meta.json and a folder per dataset
sly.convert.project_to_pascal_voc("sly_project", "pascal_voc")

Frequently asked questions.

Can I convert Supervisely to Pascal VOC without code?

Yes. Import the data with Import images in Supervisely format, check it in the image labeling toolbox, then export it with Export to Pascal VOC. Both start from the Supervisely web interface.

What changes when Supervisely becomes Pascal VOC?

Polygons, bitmaps and rectangles are exported, other shapes are skipped; only polygons and bitmaps are drawn into the masks. Image tags other than train and val are dropped. Without train and val tags the images are split 80/20.

Does Pascal VOC use the same coordinates as Supervisely?

Both use absolute pixel coordinates, written differently. Supervisely: Absolute pixels; a rectangle is stored as its top-left and bottom-right points. Pascal VOC: Absolute pixels; a box is xmin, ymin, xmax, ymax.

How do Supervisely classes carry over to Pascal VOC?

In Supervisely: classes are defined in meta.json with a name, a shape and a colour; tags can sit on images and on objects. In Pascal VOC: the class name is written in each XML object; colors.txt, added by Supervisely, maps classes to mask colours. 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 Supervisely to Pascal VOC in Python?

The Python SDK writes Pascal VOC from a Supervisely project on your disk, with no server involved. A project on the platform is downloaded first with sly.download_fast. See the SDK export tutorial.