# Annotate datasets

## Overview

Luxonis Hub includes a sample editor for manual labeling, Smart Annotations powered by a segmentation model, and model
pre-annotation for processing a larger batch. In each workflow, review the labels and move approved samples to Completed so they
contribute to dataset health and run validation.

> **Note**
> Create the dataset tasks and classes before annotating. The editor tools and compatible model checkpoints are determined by that definition.

## Annotate a sample manually

The object-detection example below draws a box around each pallet. Other task types expose their corresponding tools in the same
editor.

Open a dataset and select a sample from the grid. Use the filters to narrow samples by annotation presence, status, split, dataset
version, tags, or classes.

![Luxonis Hub dataset sample annotation editor](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-manual-1.webp)

Select the required class and use the task tool to label the image. Draw boxes for object detection, polygons for segmentation,
place skeleton points for keypoints, choose image-level classes for classification, or enter regions and text for OCR.

Use the regions and labels panel to inspect, select, or remove individual annotations.

![Luxonis Hub sample with pallet bounding boxes](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-manual-2.webp)

Click Update, choose the Sample Split, and set the Sample Status. Move reviewed work to Completed, then use the previous and next
controls to continue through the filtered set.

Add tags from the dataset grid when you need to group samples for filtering, pre-annotation, or a later versioned training run.

![Luxonis Hub sample split selection menu](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-manual-3.webp)

> **Note**
> Editing an Unannotated or Pre-annotated sample automatically changes its status to Annotated. Annotation statuses are an optional review workflow, but only Completed samples contribute to the split sizes used by health and run validation.

## Use Smart Annotations

Smart Annotations use a promptable model to accelerate region creation. They are available for object-detection datasets,
including object detection with a nested segmentation task, and for semantic-segmentation datasets.

Open a sample and click Smart Annotations. If no engine is active, start it and wait for inference to become available. Warm-up
typically takes 5–10 minutes.

![Luxonis Hub sample with Smart Annotations button](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-smart-1.webp)

After the engine is ready, choose Annotate to propose regions across the whole image, Annotate With Selection to limit proposals
to a box you draw, or Annotate With Text to prompt with a class and description. The example below shows the native text-prompt
panel.

![Luxonis Hub Smart Annotations text prompt panel](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-smart-2.webp)

Inspect the returned regions, correct or delete unsuitable proposals, assign the right classes, and click Update. Hub displays
Smart Annotation proposals above 0.5 confidence, but human review is still required.

![Luxonis Hub sample with Smart Annotation proposals](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-smart-3.webp)

## Pre-annotate with a trained model

Pre-annotation runs a PyTorch checkpoint produced by Luxonis Hub across a selected group of dataset samples. It is useful after
the first model has been trained and new, unlabeled data arrives.

Open the dataset action menu and select Preannotate.

![Luxonis Hub Preannotate Data dialog](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-preannotate-1.webp)

Choose the Annotation Status to process. Optionally filter by tags; use AND to require every selected tag or OR to accept any
selected tag.

![Luxonis Hub Preannotate annotation status options](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-preannotate-2.webp)

Select the merge strategy:

 * None: skips matching predictions to existing samples, so Hub ingests the prediction output as new samples.
 * Append Annotations: keeps existing annotations and adds predictions to matching samples.
 * Replace Annotations: removes existing annotations from matching samples before adding predictions.

Then choose a Model Checkpoint produced by a Luxonis Hub training run and submit the form.

![Luxonis Hub Preannotate merge strategy options](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-preannotate-3.webp)

Monitor the Preannotation job from Jobs. Successful samples return with the Pre-annotated status. Filter the grid to that status,
review and correct the predictions, then move approved samples to Completed.

![Luxonis Hub dataset grid with pre-annotated samples](https://docs.luxonis.com/static/images/cloud/hubai/training/datasets-annotate-preannotate-4.webp)

> **Checkpoint compatibility**
> Pre-annotation requires a PyTorch checkpoint whose tasks, task names, and classes match the dataset. If no compatible checkpoint is available, first create a project and complete a [training run](https://docs.luxonis.com/cloud/hubai/training/runs.md).

> **Update several sample statuses at once**
> To update annotation statuses in a batch, open the dataset's Samples tab and click Edit Samples. Select individual samples, choose Select All Samples from Page, or choose Select Entire Dataset. Then open Actions, select Update Annotation Status, and choose the new status.
