LabelMe JSON format

The files of the LabelMe annotation tool: one JSON per image with a list of shapes, each with a label, a shape type and points in pixels.

Data
Images
Labels
BoxesPolygonsMasksPolylinesPoints
Files
.json
Import / export
Yes / No
The format

What is the LabelMe format?

LabelMe is an open-source image annotation tool written in Python. It supports polygons, rectangles, circles, lines and points, as well as AI-assisted annotation, and saves one JSON file per image.

The file holds imagePath, imageHeight, imageWidth, an optional base64 copy of the image in imageData, and a shapes list. Each shape has a label, a shape_type and points in pixels; a mask shape carries a base64 PNG in mask.

Files

Folder structure and an example

Folder structure for import
input_folder
├── ann
│   ├── IMG_0748.json
│   └── IMG_8144.json
└── img
    ├── IMG_0748.jpeg
    └── IMG_8144.jpeg
ann/IMG_0748.json
{
  "version": "5.5.0",
  "flags": {},
  "shapes": [
    {
      "label": "cat_polygon",
      "points": [[1038.0, 91.0], [2363.0, 1311.0], [2373.0, 3236.0]],
      "group_id": null,
      "description": "",
      "shape_type": "polygon",
      "flags": {},
      "mask": null
    },
    {
      "label": "cat_rectangle",
      "points": [[1033.0, 76.0], [2368.0, 1311.0]],
      "group_id": null,
      "description": "",
      "shape_type": "rectangle",
      "flags": {},
      "mask": null
    }
  ],
  "imagePath": "IMG_0748.jpeg",
  "imageData": null,
  "imageHeight": 3382,
  "imageWidth": 2536
}
In and out

Import and export LabelMe in Supervisely

Import LabelMe into Supervisely

  • Import data (Auto Import)

    Reads LabelMe .json files next to their images, with the shape types polygon, rectangle, circle, point, line, linestrip and mask.

Export from Supervisely to LabelMe

The Supervisely Ecosystem has no LabelMe exporter. Export the project in Supervisely JSON or COCO and convert from there if a tool needs LabelMe files.

All apps are in the Ecosystem, under Import and Export. Every project is stored in Supervisely JSON in between.

Conversion

Converting LabelMe to and from Supervisely JSON

Import only: there is no export to LabelMe.

LabelMeSupervisely JSONNotes
labelclass titleOne class per label.
polygonpolygonPoints become the exterior.
rectanglerectangleTwo corner points.
circlepolygonThe circle (centre and a point on it) is approximated by a polygon.
line, linestripline (polyline)
pointpoint
maskbitmapThe base64 PNG becomes the bitmap, placed at the first point.