Annotation basics

Shape types overview

Labelme supports the following annotation shapes:

  • Polygon — freeform closed region defined by click-placed vertices
  • Rectangle — axis-aligned bounding box
  • Oriented Rectangle — rotatable bounding box
  • Circle — circular region defined by center point and edge point
  • Line — open two-point line segment
  • LineStrip — open multi-point polyline
  • Point — single landmark point
  • AI-Points / AI-Box — automatic segmentation prompted by clicks or a box; backend and output shape are configurable (see below)

How to create and finish each shape

By default, after you finish any shape, a label popup appears — type or pick a label to confirm it. Canceling the popup returns the shape to the in-progress drawing state rather than committing it (for Point and the AI modes, canceling discards it outright, since there's nothing left to keep drawing).

Polygon

  1. Switch to Polygon mode (toolbar button, or the keyboard shortcut below).
  2. Click to place vertices along the object border.
  3. Finish: click back near the first vertex, double-click the last point, or press Enter/Space once at least 3 points are placed.

Rectangle (Bounding Box)

  1. Switch to Rectangle mode (toolbar button, or the keyboard shortcut below).
  2. Click one corner of the object.
  3. Click the opposite corner to finish. Hold Shift while placing the second corner to constrain to a square.

Labelme stores a rectangle as the two corners in the order you clicked them — it does not normalize them to a top-left/bottom-right pair. If your workflow needs that order, compute the min/max yourself from the two points.

Oriented Rectangle

  1. Switch to Oriented Rectangle mode from the toolbar.
  2. Click the first corner.
  3. Click again to set the first edge's direction.
  4. Click a third time to set both the edge's length and the rectangle's width.

Circle

  1. Switch to Circle mode from the toolbar.
  2. Click to set the center of the circle.
  3. Click again to set the edge point — this defines the radius.

Line

  1. Switch to Line mode from the toolbar.
  2. Click to set the start point.
  3. Click to set the end point — the line is created automatically.

LineStrip (Polyline)

  1. Switch to LineStrip mode from the toolbar.
  2. Click to add vertices one by one.
  3. Finish: double-click the last point, Ctrl+click, or press Enter/Space.

Point

  1. Switch to Point mode from the toolbar.
  2. Single click anywhere on the image — the point is placed immediately.

AI-Points / AI-Box

Both modes use the AI-Assisted Annotation widget in the toolbar, where you pick a backend — Sam2 (balanced) by default, with Sam2 and Sam also selectable in speed/balanced/accuracy variants and EfficientSam in speed/accuracy variants; Sam3 is available for AI-Box only, not for point prompts — and an output shape (polygon, mask, rectangle, oriented rectangle, or circle). The chosen model's weights download once on first use.

AI-Points:

  1. Switch to AI-Points mode from the toolbar.
  2. Click inside the object to add a positive point; Shift+click to add a negative point.
  3. Press Enter/Space or Ctrl+click to accept.

AI-Box:

  1. Switch to AI-Box mode from the toolbar.
  2. Click one corner, then click the opposite corner, to segment the boxed object.

Edit mode vs Create mode

Labelme has two main interaction modes:

  • Edit mode — select, move, resize, and delete existing shapes.
  • Create mode — draw new shapes.

Switching modes:

  • Press Ctrl+J, or use a toolbar button, to enter Edit mode.
  • Pick any shape tool (toolbar button, or the keyboard shortcut below where one exists) to enter Create mode for that shape.
  • While drawing, Escape cancels the shape in progress — it does not switch modes on its own.

In Edit mode you can:

  • Click a shape to select it (its outline turns white).
  • Drag a shape to move it.
  • Drag a vertex to reposition it.
  • Press Delete to remove the selected shape(s) (asks for confirmation).

Common keyboard shortcuts

  • D — Next image
  • A — Previous image
  • Ctrl+S — Save annotation (Labelme also auto-saves by default)
  • Ctrl+Z — Undo last action (removes the last placed point while a shape is being drawn)
  • Delete — Delete selected shape(s)
  • Ctrl+N — Create Polygon mode
  • Ctrl+R — Create Rectangle mode
  • Ctrl+J — Edit mode
  • Enter / Space — Finish the current shape, once it has enough points
  • Escape — Cancel the shape being drawn

Oriented rectangle, circle, line, linestrip, point, AI-Points, and AI-Box have no default shortcut — use the toolbar button.

AI annotation quick start

Besides the click/box prompts above, Labelme can also annotate from a text description, via Sam3 or YOLO-World.

SAM3 / YOLO-World — text-to-annotation

Instead of clicking, you can type what you want annotated.

  1. Pick Polygon, Rectangle, AI-Points, or AI-Box mode to enable the AI Text-to-Annotation field in the toolbar — the field is enabled in all four, but which of them actually produce a shape depends on the model you pick next.
  2. Pick a model: YOLO-World (fast) (the default) only returns bounding boxes, so it errors unless the output resolves to rectangle, circle, or oriented rectangle (all buildable from a box) — polygon or mask output shows a "Mask Output Unavailable" error. SAM3 (smart) supports every output shape, including polygon and mask, but only uses the first comma-separated term you type — YOLO-World matches every term.
  3. Type your prompt(s), e.g. dog,red car (no space after the comma — it becomes part of the label), and submit.
  4. Labelme creates a shape around each match — edit or undo the result.

These AI models run locally and offline, once their weights are downloaded on first use — your images never leave your computer.

Next guide:

1. Annotate image with Labelme