Convert LabelMe
to YOLO

Import LabelMe, check the labels in the labeling toolbox, export YOLO. YOLO is the format Ultralytics YOLO models train on.

Format differences

LabelMe vs YOLO

LabelMe and YOLO describe the same objects in different files and notations.

LabelMeYOLO
Annotation filesOne JSON file per image with a shapes list and the image size.One TXT file per image in labels/, and a YAML file (data_config.yaml) with the class names and the train and val folders.
CoordinatesAbsolute pixels; every shape is a list of points, a rectangle two of its corners.Normalized to 0–1; a box is x_center, y_center, width, height.
ShapesPolygons, rectangles, circles, points, lines, line strips and masks.Boxes for detection, polygons for segmentation, keypoints for pose: one task per label set.
ClassesEach shape carries a free-text label; there is no separate class list.Each line starts with a zero-based class index; the names are listed in the YAML file.

What the conversion changes

Between the formats

  • LabelMe stores pixel points; YOLO wants them divided by the image size, which the export does.
  • LabelMe rectangles fit YOLO detection, polygons YOLO segmentation.

Import LabelMe

  • Polygons, rectangles, circles, points, lines, line strips and masks are read.

Export to YOLO

  • For detection the project must hold rectangles only: Convert Class Shape turns polygons and masks into boxes first.
  • For segmentation, polygons, bitmaps and alpha masks are exported; for pose, keypoint graphs. Other shapes are skipped.
  • The train and val image tags decide the split; untagged images go to train.
Workflow

Convert LabelMe to YOLO in three steps

  1. 01

    Import LabelMe

    Start an import in a Supervisely project and drop in the folder with the images and their LabelMe JSON files: the importer recognises the format (LabelMe 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 YOLO.

  3. 03

    Export to YOLO

    Open the menu of the project, choose Download via app and run Convert Supervisely to YOLO v5 format for detection or Export to YOLOv8 format for segmentation and pose. 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

After the import, the Python SDK downloads the project as Supervisely JSON and writes YOLO on your disk.

Install it with pip install supervisely.

SDK export tutorial
convert.py
import supervisely as sly

# SERVER_ADDRESS and API_TOKEN come from the environment
api = sly.Api.from_env()
# ID of the project the LabelMe import created
sly.download_fast(api, project_id=12345, dest_dir="sly_project")
# task_type: "detect", "segment" or "pose"
sly.convert.project_to_yolo("sly_project", "yolo", task_type="detect")

Frequently asked questions.

Can I convert LabelMe to YOLO without code?

Yes. Import the data with the LabelMe import, check it in the image labeling toolbox, then export it with Convert Supervisely to YOLO v5 format or Export to YOLOv8 format. Both start from the Supervisely web interface.

What changes when LabelMe becomes YOLO?

LabelMe stores pixel points; YOLO wants them divided by the image size, which the export does. LabelMe rectangles fit YOLO detection, polygons YOLO segmentation. Polygons, rectangles, circles, points, lines, line strips and masks are read.

Does YOLO use the same coordinates as LabelMe?

No. LabelMe uses absolute pixel coordinates, YOLO coordinates divided by the image size. LabelMe: Absolute pixels; every shape is a list of points, a rectangle two of its corners. YOLO: Normalized to 0–1; a box is x_center, y_center, width, height. The export does the conversion.

How do LabelMe classes carry over to YOLO?

In LabelMe: each shape carries a free-text label; there is no separate class list. In YOLO: each line starts with a zero-based class index; the names are listed in the YAML file. 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 LabelMe to YOLO in Python?

After the import, the Python SDK downloads the project as Supervisely JSON and writes YOLO on your disk. See the SDK export tutorial.