Overview

Labelme frequently asked questions

Unofficial preview. Docsbook assembled this page from the public wkentaro/labelme README.md and examples/ directory. It is not affiliated with, endorsed by, or maintained by the Labelme project. The official documentation lives at labelme.io/docs.

Every answer below is drawn from the repository. Questions the repository does not answer are not listed rather than guessed at.

How do I convert a Labelme JSON file to a numpy array?

Run the export_json.py script from examples/tutorial, which turns one JSON file into a standard set of files: img.png, a uint8 label.png, a label_viz.png visualisation, and label_names.txt mapping label values to names.

./export_json.py apc2016_obj3.json

To work with the array in your own code instead, read the JSON directlyexamples/utils.py is the reference implementation and depends only on the standard library, numpy and PIL.

How do I load a label PNG file?

Use PIL.Image.open. Labelme's label PNGs use very low pixel values as class indices, and other readers may not return them correctly:

import numpy as np
import PIL.Image
 
lbl = np.asarray(PIL.Image.open("apc2016_obj3/label.png"))
print(lbl.dtype)      # uint8
print(np.unique(lbl)) # e.g. [0 1 2 3]

scipy.misc.imread and skimage.io.imread may not work correctly on these files. The reading annotations guide covers this in full.

Which export formats does Labelme support?

The repository ships scripts for two: Pascal VOC and COCO.

  • Pascal VOClabelme2voc.py, for semantic segmentation, instance segmentation and bounding-box detection.
  • COCOlabelme2coco.py, for instance segmentation, producing a single annotations.json.
Does Labelme have a Python API I can import?

No. Labelme is an application, not a library, and it exposes no stable Python API. In v7 the internal modules were renamed with underscore prefixes, so import labelme.app, labelme.utils and labelme.widgets no longer work.

The three interfaces the project keeps stable are the command line, the on-disk JSON annotation format, and the ~/.labelmerc config format. If you previously imported Labelme internals, pin labelme<7 and vendor the code you need, or copy examples/utils.py.

Which Python versions does Labelme support?

v7.x supports Python 3.12 to 3.14 on Qt6 (PySide6), on 64-bit macOS, Windows and Linux. v6.3.x is the maintenance line for Python 3.10 and 3.11 on Qt5 and older operating systems. The project follows SPEC 0 for dropping Python versions, in step with numpy, scipy and scikit-image.

The platform support page has the full matrix.

Can I use Labelme in a language other than English?

Yes. The README states Labelme is available in 20 languages, and sets the interface language through the locale:

LANG=ja_JP.UTF-8 labelme

The config file also has a language key that takes a locale code such as ja_JP; leaving it empty follows the system locale.

How do I stop annotators inventing their own label names?

Pass the label list on the command line and validate against it:

labelme data_annotated --labels labels.txt --validate-label exact

--labels accepts either a comma-separated list or a file. --validate-label exact rejects anything not on the list. Labels are sorted alphabetically unless you pass --no-sort-labels, which keeps the order you supplied.

How do I annotate a video?

Split the video into frames and annotate the frames as a directory. The repository suggests video-cli:

pip install video-cli
video-toimg your_video.mp4
labelme your_video/

Add --keep-prev so each frame opens with the previous frame's annotations already in place. See the video annotation guide.

Is Labelme open source?

The repository at wkentaro/labelme is published under GPL-3.0. A standalone application is also sold on labelme.io as a one-time purchase; the editions page compares the two install routes and links to the current pricing.

Updated

Was this page helpful?