docs/en/platform/data/annotation.md
Ultralytics Platform includes a powerful annotation editor for labeling images with bounding boxes, polygons, keypoints, oriented boxes, and classifications. The editor supports manual drawing and SAM-powered smart annotation.
graph TB
subgraph Manual["Manual Tools"]
A[Box] & B[Polygon] & C[Keypoint] & D[OBB] & E[Classify]
end
subgraph AI["AI-Assisted"]
F[SAM Smart]
end
Manual --> H[Save Labels]
AI --> H
The annotation editor supports all 5 YOLO task types:
| Task | Tool | Annotation Format |
|---|---|---|
| Detect | Rectangle | Bounding boxes (x, y, width, height) |
| Segment | Polygon | Pixel-precise masks (polygon vertices) |
| Pose | Keypoint | Skeleton templates (Person, Hand, Face, Dog, Box, custom) |
| OBB | Oriented Box | Rotated bounding boxes (4 corners) |
| Classify | Class Selector | Image-level labels |
!!! tip "Multi-Task Annotations"
All 5 annotation types are stored together on each image. You can switch the dataset's active task type without losing existing annotations — they are preserved and reappear when you switch back.
??? info "Object Detection"
**What it does:** Identifies objects and their locations with axis-aligned bounding boxes.
**Label format:** [`class_id center_x center_y width height`](../../datasets/detect/index.md#ultralytics-yolo-format) (all normalized 0-1)
**Example:** `0 0.5 0.5 0.2 0.3` — Class 0 centered at (50%, 50%) with 20% width and 30% height
**Use cases:** Inventory counting, traffic monitoring, wildlife detection, security systems
??? info "Instance Segmentation"
**What it does:** Creates pixel-precise masks for each object instance.
**Label format:** [`class_id x1 y1 x2 y2 x3 y3 ...`](../../datasets/segment/index.md#ultralytics-yolo-format) (polygon vertices, normalized 0-1)
**Example:** `0 0.1 0.1 0.9 0.1 0.9 0.9 0.1 0.9` — Quadrilateral mask
**Use cases:** Medical imaging, autonomous vehicles, photo editing, agricultural analysis
??? info "Pose Estimation"
**What it does:** Detects body keypoints for skeleton tracking.
**Label format:** [`class_id cx cy w h kx1 ky1 v1 kx2 ky2 v2 ...`](../../datasets/pose/index.md#ultralytics-yolo-format)
- Visibility flags: `0`=not labeled, `1`=labeled but occluded, `2`=labeled and visible
**Example:** `0 0.5 0.5 0.2 0.3 0.6 0.7 2 0.4 0.8 1` — Person with 2 keypoints
**Use cases:** Sports analysis, physical therapy, animation, gesture recognition
??? info "Oriented Bounding Box (OBB)"
**What it does:** Detects rotated objects with angle-aware bounding boxes.
**Label format:** [`class_id x1 y1 x2 y2 x3 y3 x4 y4`](../../datasets/obb/index.md#yolo-obb-format) (four corner points, normalized)
**Example:** `0 0.1 0.1 0.9 0.1 0.9 0.9 0.1 0.9` — Rotated rectangle
**Use cases:** Aerial imagery, document analysis, manufacturing inspection, ship detection
??? info "Image Classification"
**What it does:** Assigns a single label to the entire image.
**Label format:** [Folder-based](../../datasets/classify/index.md#dataset-structure-for-yolo-classification-tasks) — images organized by class name (`train/cats/`, `train/dogs/`)
**Use cases:** Content moderation, quality control, medical diagnosis, scene recognition
To annotate images:
Edit to enter annotation modeSave when finishedgraph LR
A[Open Dataset] --> B[Click Image]
B --> C[Click Edit]
C --> D[Draw Annotations]
D --> E[Save]
E --> F[Next Image]
F --> B
style C fill:#2196F3,color:#fff
style D fill:#FF9800,color:#fff
style E fill:#4CAF50,color:#fff
The editor provides two annotation modes, selectable from the toolbar:
| Mode | Description | Shortcut |
|---|---|---|
| Manual | Draw annotations with task-specific tools (all 5 task types) | V |
| Smart | SAM or YOLO model-assisted annotation (detect, segment, OBB only) | S |
Draw rectangular boxes around objects:
Draw!!! tip "Resize and Move"
- Drag 8 corner/edge handles to resize
- Drag the center to move
- Press `Delete` or `Backspace` to remove selected annotation
Draw precise polygon masks:
DrawShift and move the mouse to freehand-draw dense pointsEnter or Escape to close the polygon!!! tip "Edit Vertices"
- Drag individual vertices to adjust
- Drag the entire polygon to move
- Click on a vertex and press `Delete` to remove it
Annotate poses using skeleton templates. Select a template from the toolbar, click once to place all keypoints, then drag individual keypoints to adjust positions.
DrawEnter to confirm or Escape to cancelThe editor includes 5 built-in templates:
| Template | Keypoints | Description |
|---|---|---|
| Person | 17 | COCO human body pose — nose, eyes, ears, shoulders, elbows, wrists, hips, knees, ankles |
| Hand | 21 | Ultralytics Hand Keypoints — wrist, thumb, index, middle, ring, pinky joints |
| Face | 68 | iBUG 300W facial landmarks — jaw, eyebrows, nose, eyes, mouth |
| Dog | 18 | AP-10K animal pose — nose, head, neck, shoulders, tailbase, tail, and 4 legs (elbows, knees, paws) |
| Box | 4 | Corner keypoints — top-left, top-right, bottom-right, bottom-left |
Create custom templates for any pose structure:
Custom templates are saved to your account and available in all pose datasets.
!!! tip "Template Workflow"
The template system replaces manual sequential keypoint placement. Instead of clicking 17 times for a COCO skeleton, select the Person template and click once — all keypoints are placed in the correct skeleton layout. Then drag to adjust positions for the specific pose.
!!! info "Keypoint Visibility"
Each keypoint has a visibility flag: `0` = not labeled, `1` = labeled but occluded, `2` = labeled and visible. Occluded keypoints (behind other objects) should be marked with visibility `1` — the model learns to infer their position.
Draw rotated boxes for angled objects:
DrawAssign image-level class labels:
1-9Smart annotation adds model-assisted annotation to the editor. In Smart mode, you can use Segment Anything Model (SAM) for click-based annotation or use pretrained Ultralytics YOLO models and your own fine-tuned YOLO models to add predictions as annotations. Smart annotation is available for detect, segment, and OBB tasks.
With a SAM model selected:
Smart or press SEnter or Escape to save the annotation, or enable auto-apply for one-click workflowsgraph LR
A[Press S] --> B[Left-click Object]
B --> C[SAM Generates Mask]
C --> D{Auto-apply?}
D -->|Yes| E[Mask Applied Automatically]
D -->|No| F{Accurate?}
F -->|Yes| G[Enter to Save]
F -->|No| H[Add +/- Points]
H --> C
style A fill:#2196F3,color:#fff
style C fill:#FF9800,color:#fff
style E fill:#4CAF50,color:#fff
style G fill:#4CAF50,color:#fff
!!! tip "SAM Tips"
- Start with a click on the object center
- Click again outside the mask to expand coverage
- Click inside the mask to subtract unwanted regions
- Enable **auto-apply** (`A`) for one-click annotation
- Hold `Shift` while auto-apply is on to place multiple points before the mask is applied
- Works best for distinct objects with clear edges
- Use a few refinement clicks for elongated or overlapping objects
SAM smart annotation can generate:
!!! warning "SAM Task Support"
SAM smart annotation is only available for **detect**, **segment**, and **OBB** tasks. Classification and pose tasks require manual annotation.
Auto-apply mode speeds up Smart annotation by automatically saving the SAM mask after each click — no need to press Enter. Toggle it with the auto-apply button in the toolbar or press A.
| Mode | Behavior |
|---|---|
| Auto-apply ON | Mask applies automatically after each click |
Auto-apply ON + Shift | Place multiple points first, mask applies on release |
| Auto-apply OFF (default) | Place points freely, press Enter to apply |
!!! tip "When to Use Auto-Apply"
Auto-apply is ideal for datasets with well-separated objects where a single click produces an accurate mask. For complex or overlapping objects, turn auto-apply off and use multiple positive/negative points to refine the mask before saving.
When Smart mode is active, a model picker appears in the toolbar. Five SAM models are available — choose based on the speed vs. accuracy trade-off that suits your dataset:
| Model | Size | Speed | Notes |
|---|---|---|---|
| SAM 2.1 Tiny | 75 MB | Fastest | |
| SAM 2.1 Small | 88 MB | Fast | |
| SAM 2.1 Base | 154 MB | Moderate | |
| SAM 2.1 Large | 428 MB | Slower | Most accurate of SAM 2.1 |
| SAM 3 | 3.45 GB | Slowest | Default, latest generation |
Switching models while Smart mode is active re-initializes the predictor for the current image automatically.
With a YOLO model selected, Smart annotation can add predictions from pretrained Ultralytics models or your own fine-tuned models.
Smart or press SOfficial or My Models)Predict!!! tip "YOLO Model Notes"
- The model picker only lists models that match the current dataset task.
- Duplicate predictions are skipped when they overlap an existing annotation of the same class at IoU `0.7` or higher.
The annotation editor includes a collapsible class sidebar on the right side of the canvas. The sidebar provides:
Enter on an exact match to select it, or create a new class if no match exists.Add class at the bottom of the list, type a name, and optionally pick a custom color. Press Enter to create.1-9 to quickly select the first 9 classes.Right-click on selected annotations to open a context menu with:
| Action | Shortcut |
|---|---|
| Delete Annotation(s) | Delete / Backspace |
| Bring to Front | Cmd/Ctrl+Shift+] |
| Send to Back | Cmd/Ctrl+Shift+[ |
| Bring Forward | Cmd/Ctrl+] |
| Send Backward | Cmd/Ctrl+[ |
The visibility dropdown (eye icon) lets you toggle display of individual elements:
| Toggle | Description |
|---|---|
| Annotations | Show or hide all annotation overlays |
| Class labels | Show or hide class name labels on annotations |
| Show pixels | Toggle pixelated rendering for zoom inspection (fullscreen) |
| Crosshairs | Show crosshair cursor with pixel coordinates (edit mode) |
| Nav thumbnails | Show navigation thumbnail strip (fullscreen) |
| Show all | Toggle annotations, labels, crosshairs, and thumbnails at once (does not affect pixelated) |
In edit mode, a crosshair overlay tracks the cursor position and displays pixel coordinates on the canvas. This helps place annotations with precision. Toggle it via the visibility dropdown.
In Smart mode, SAM provides a real-time hover preview before you click any points. This preview is available for detect, segment, and OBB tasks. Once you add refinement clicks, the preview updates to reflect the current mask and the annotation type for the active task.
For segment annotations, you can edit polygon vertices after drawing:
Delete to remove itDefine annotation classes for your dataset in the Classes tab:
Classes tabAdd or press EnterYou can create new classes directly while annotating without leaving the editor:
Add New ClassThis allows for a seamless workflow where you can define classes as you encounter new object types in your data.
!!! tip "Unified Classes Table"
All classes across your dataset are managed in a unified table. Changes to class names or colors apply throughout the entire dataset automatically.
Each class is assigned a color from the Ultralytics palette. You can customize colors using the color picker on the Classes tab. Colors are consistent across the platform for easy recognition.
Efficient annotation with keyboard shortcuts:
=== "General"
| Shortcut | Action |
| ----------------------------- | ---------------------------- |
| `Cmd/Ctrl+S` | Save annotations |
| `Cmd/Ctrl+Z` | Undo |
| `Cmd/Ctrl+Y` | Redo |
| `Escape` | Save / Deselect / Exit |
| `Delete` / `Backspace` | Delete selected annotation |
| `1-9` | Select class 1-9 |
| `Cmd/Ctrl+Scroll` | Zoom in/out |
| `Cmd/Ctrl++` or `Cmd/Ctrl+=` | Zoom in |
| `Cmd/Ctrl+-` | Zoom out |
| `Cmd/Ctrl+0` | Reset to fit |
| `Space+Drag` | Pan canvas when zoomed |
| `Shift+Click` | Multi-select annotations |
| `Cmd/Ctrl+A` | Select all annotations |
=== "Modes"
| Shortcut | Action |
| -------- | ------------------------------- |
| `V` | Manual mode (draw) |
| `S` | Smart mode (SAM or YOLO model) |
=== "Drawing"
| Shortcut | Action |
| ----------------------- | -------------------------------------------------------------------------------------- |
| `Click+Drag` | Draw bounding box (detect/OBB) |
| `Click` | Add polygon point (segment) / Place skeleton (pose) / Place SAM point (smart) |
| `Shift (hold) + Move` | Freehand draw — continuously adds polygon vertices as the mouse moves |
| `Click inside mask` | Subtract region from SAM mask (negative point) |
| `Click outside mask` | Add to SAM mask (positive point) |
| `Shift (hold) + Click` | Place multiple SAM points before auto-apply commits (Smart mode, auto-apply on) |
| `A` | Toggle auto-apply (Smart mode) |
| `Enter` | Complete polygon / Confirm pose / Save SAM annotation |
| `Escape` | Cancel pose / Save SAM annotation / Deselect / Exit |
=== "Arrange (Z-Order)"
| Shortcut | Action |
| ------------------ | -------------- |
| `Cmd/Ctrl+]` | Bring forward |
| `Cmd/Ctrl+[` | Send backward |
| `Cmd/Ctrl+Shift+]` | Bring to front |
| `Cmd/Ctrl+Shift+[` | Send to back |
??? tip "View All Shortcuts"
Click the keyboard icon in the annotation toolbar to open the shortcuts reference.
The annotation editor maintains a full undo/redo history:
Cmd/Ctrl+ZCmd/Ctrl+YHistory tracks:
!!! info "Unlimited Undo"
The undo stack has no fixed limit — you can undo all changes made during the current editing session, back to the original state of the image when you clicked `Edit`.
Annotations are saved when you click Save or press Cmd/Ctrl+S:
Cmd/Ctrl+S!!! warning "Save Your Work"
Always save before navigating to another image. Unsaved changes will be lost.
SAM provides high-quality masks for most objects. Accuracy depends on:
For best results, start with a click on the object center, then use outside-mask clicks to add coverage and inside-mask clicks to subtract nearby objects or background.
Yes, upload your dataset with YOLO-format label files. The Platform automatically parses and displays them in the editor.
After drawing an annotation:
The keyboard shortcut 1-9 quickly selects classes.
Yes, but for best results:
Unlabeled to identify images that still need annotationSAM 3 is the default and the latest generation model — start there for the highest quality masks. Switch to SAM 2.1 Small for a faster interactive workflow on common objects, or SAM 2.1 Large when you need higher mask precision on complex shapes. Use SAM 2.1 Tiny for maximum speed on simple, high-contrast objects.
SAM smart annotation is available for detect, segment, and OBB tasks. Classification and pose tasks use manual annotation only.
Yes. Click the + button next to the skeleton template picker to open the template editor. Place keypoints, name them, draw connections, and save. Custom templates are stored in your account and available across all pose datasets.
Click the template picker dropdown in the annotation toolbar. Select any built-in template (Person, Hand, Face, Dog, Box) or your saved custom templates. The selected template determines which keypoints are placed when you click on the image.