> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/labeling/labeling-ai-assistance/auto-suggestion.md).

# Auto Suggestion

Auto Suggestion detects objects on images and video frames so you can annotate them with a single click. In the video editor, you can also track those objects across later frames.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FG09mFubGFlABym1ox62P%2FKapture%202025-09-09%20at%2014.45.00.gif?alt=media&amp;token=b04da847-e190-4984-8535-cbee0966d954" alt=""><figcaption></figcaption></figure>

Ango Hub downloads the models for Auto Suggestion and video tracking and runs them in your browser. Auto Suggestion uses a quantized version of SAM2 by default.

You can also upload your own custom model weights, and Auto Suggestion will use them in your project.

## Supported

### Labeling Tools

Use [Bounding Box](https://docs.imerit.net/labeling/labeling-tools/tools/bounding-box.md), [Polygon](https://docs.imerit.net/labeling/labeling-tools/tools/polygon.md), or [Segmentation](https://docs.imerit.net/labeling/labeling-tools/tools/segmentation.md) on images and video. [Polyline](https://docs.imerit.net/labeling/labeling-tools/tools/polyline.md) is also available on images.

### Asset Types

* Images (single and [image sequences](https://docs.imerit.net/data/importing-assets/bundled-assets/importing-multiple-images-in-one-asset-grid-or-carousel.md))
* Video

## How to use Auto Suggestion

In the labeling editor, click on the tool you'd like to use Auto Suggestion with. The Auto Suggestion button will appear:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2Ffeoa7ErjaRAhfjr7OHnY%2Fimage.png?alt=media&amp;token=e392c9b4-eaf5-4d9b-9833-3717b1442efe" alt=""><figcaption></figcaption></figure>

Click on the Auto Suggestion button. A message will appear at the bottom of the screen informing you that the machine learning model used to power this feature is being downloaded. You may keep using Ango Hub normally as the model is downloaded in the background.

If Ango Hub detects that you have already downloaded the model previously by using this feature, and your browser has not deleted it, this step will be skipped.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2F2vXIxJ5VXNOQAKu9ATpm%2Fimage.png?alt=media&amp;token=0ba78bfb-2f27-4950-93a9-896402f37246" alt="" width="375"><figcaption></figcaption></figure>

Once the download finishes, the model processes the image or current video frame in your browser.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2F5yzcKitdqQev7d6Myg5T%2Fimage.png?alt=media&amp;token=7e53f3fd-1b32-4d42-af9c-e8b4c482747c" alt="" width="313"><figcaption></figcaption></figure>

Once processing is completed, hover over the image or video frame. As you hover, the model will automatically detect the object or connected mask region under your cursor. Clicking on the object will finalize the annotation.

For the Bounding Box tool, Auto Suggestion creates a bounding box around the detected region. For Polygon, Polyline, and Segmentation tools, it creates the corresponding annotation type from the detected region.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FG09mFubGFlABym1ox62P%2FKapture%202025-09-09%20at%2014.45.00.gif?alt=media&amp;token=b04da847-e190-4984-8535-cbee0966d954" alt=""><figcaption></figcaption></figure>

Once you are done creating annotations, click on the Auto Suggestion button again to turn it off.

If the model fails to download or the image or frame fails to load or process, turn Auto Suggestion off and back on to retry. If Ango Hub cannot generate a suggestion, hover over the object again.

## Track objects across video frames

1. Pause the video on a frame where the object is visible.
2. Select the Bounding Box, Polygon, or Segmentation tool and turn on **Auto Suggestion**. Hover over the object and click when the preview outlines it.
3. Select the new annotation, then click **Propagate** near the bottom of the video. To track several objects together, create them on the same frame, then Shift-click to select up to 10.
4. Review the result in the propagation bar and scrub through the new keyframes on the timeline before saving. For a run with several objects, hover over the result to see how each object was tracked.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2Fgit-blob-5c8de0e15fc7887505ecf640bcefe231966d7434%2Fvideo-auto-suggestion-propagate.png?alt=media" alt="A selected bounding box on a video frame and the Propagate 1 of 1 from frame 1 button"><figcaption></figcaption></figure>

Ango Hub adds a keyframe on each tracked frame, up to the end of the annotation's segment or until it reaches an existing keyframe or an out-of-view interval. If an object leaves the frame, its segment can end at the last tracked frame. To continue tracking an object after reaching the end of its segment, extend the segment on the timeline, dismiss the result if it is still visible, and click **Propagate** again in the same editor session.

Click **Cancel** during a run to keep the keyframes tracked so far. Use **Undo** to remove the keyframes added by the run in one step.

## Prevent overlaps with Auto-Subtract

When using Auto Suggestion with the Polygon or Segmentation tool, enable **Auto-Subtract** to exclude areas already covered by existing annotations of the same tool type. Click a suggested region to create the annotation with those overlapping areas removed. Existing annotations remain unchanged.

You can enable Auto-Subtract before or after turning on Auto Suggestion. Auto-Overwrite, Auto-Merge, and Eraser are unavailable while Auto Suggestion is active. If the suggested region is fully covered by existing annotations, no new annotation is created.

Polygon results must still contain one region without holes. If subtraction would split the polygon into separate regions or create a hole, Ango Hub displays a warning and does not create it. Use the Segmentation tool when you need multiple regions or holes.

## Use your Own Model

From your project settings, navigate to the "Auto Suggestion" section:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FtDc4A5mz9r71fqFA4bQb%2Floreshot-20251029-084213%402x.png?alt=media&amp;token=ed39da0d-3b30-4179-832d-334ee7bd4da2" alt=""><figcaption></figcaption></figure>

### Overview

The preparation process involves four main steps:

1. **Prepare model** – Load SAM2 and its weights.
2. **Export ONNX** – Match model inputs and outputs.
3. **Upload** – Upload the exported ONNX files.
4. **Use in editor** – Initialize and decode points for use in the application.

### Step 1: Prepare Model

Load the SAM2 model along with its pre-trained weights.

#### **Encoder/Decoder ONNX Expectations**

* Encoder input:
  * Image tensor of shape `[1, 3, H, W]` (default: `H = W = 1024`)
* Encoder outputs:
  * `high_res_feats_0`
  * `high_res_feats_1`
  * `image_embed`

    *(Dimensions must align with decoder expectations.)*
* Decoder inputs:

  Must match the app’s expected structure:

  * `image_embed`
  * `high_res_feats_0`, `high_res_feats_1`
  * `point_coords [1, 1, 2]`
  * `point_labels [1, 1]`
  * `mask_input [1, 1, 256, 256]`
  * `has_mask_input [1]`
  * `orig_im_size [2]`
* Decoder outputs:
  * `masks`
  * `iou_predictions`
  * `low_res_masks`

From the Auto Suggestion settings page, download:

* the Python export script
* requirements.txt

### Step 2: Export ONNX

Once the model is oaded, export the encoder and decoder to the ONNX format. Ensure the inputs and outputs match the specifications listed above.

### Step 3: Upload

Use the upload buttons in the Auto Suggestion section of the project settings to load your exported ONNX files.

### Step 4: Activate

Enable the "Use Custom Segmentation Models" toggle to use your custom model in the project.

That's it - you can now use the Auto Suggestion feature in your project and it'll use your model.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.imerit.net/labeling/labeling-ai-assistance/auto-suggestion.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
