Overview

Labelme command line reference

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

The command line is one of the three interfaces the Labelme project keeps stable, alongside the JSON annotation format and the ~/.labelmerc config format. Run labelme --help for the version installed on your machine.

Positional argument#

Argument Description
path An image file, a label file, or a directory. A directory loads every image in it. Optional — labelme with no argument opens an empty window.

Output and configuration#

Flag Description
--output Where annotations are written. A path ending in .json writes a single annotation to that file, and only one image can be annotated that way. Any other path is treated as a directory, and each annotation is named after its image.
--config A config file path or a YAML-format string. Defaults to the user config file, ~/.labelmerc.
--reset-config Reset window geometry and dock layout.
--version, -V Print the application name and version, then exit.
--logger-level Logger verbosity. Defaults to debug.

Labels and flags#

Flag Description
--labels A comma-separated list of labels, or a file containing them.
--validate-label Label validation type. exact is the only accepted value; it rejects any label not in --labels.
--no-sort-labels Show labels in the order supplied instead of alphabetically. Sorted is the default. The old spelling --nosortlabels is deprecated.
--flags A comma-separated list of image-level flags, or a file containing them. Flags apply to the whole image.
--label-flags A YAML string of per-label flags, or a file containing the equivalent JSON. Keys are regular expressions matched against the label, for example {person-\d+: [male, tall], .*: [occluded]}. The old spelling --labelflags is deprecated.

Annotation behaviour#

Flag Description
--with-image-data Store the image itself inside the JSON file as base64. Off by default.
--no-auto-save Disable auto-save. Auto-save is on by default.
--keep-prev Open each image with the previous image's annotations already in place. Built for consecutive video frames.
--epsilon Distance in pixels used to find the nearest vertex on the canvas.

Flags with a config equivalent#

Anything you pass on most runs belongs in the config file instead. These flags map directly onto keys in ~/.labelmerc:

Flag Config key
--with-image-data with_image_data
--no-auto-save auto_save: false
--keep-prev keep_prev
--no-sort-labels sort_labels: false
--labels labels
--flags flags
--label-flags label_flags
--validate-label validate_label
--epsilon epsilon

A flag passed on the command line takes precedence for that run. See the configuration reference.

Updated

Was this page helpful?