> For the complete documentation index, see [llms.txt](https://developer.supervisely.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.supervisely.com/app-development/advanced/in-depth-app-development/chapter-1-headless/part-5-integrate-custom-tracker-into-videos-annotator-tool-opencv-tracker.md).

# Part 5 — Integrate custom tracker into Videos Annotator tool \[OpenCV Tracker]

### Table of contents

1. [Videos Annotator?](#step-1-videos-annotator)
2. [Trackers](#step-2-trackers)
3. [Creating the APP](#step-3-creating-the-app)
4. [Results](#step-4-results)

### Step 1 — Videos Annotator?

Ok. This is the video annotation tool available in Supervisely.\
To launch the Videos Annotator, click on the videos dataset. Done!

![Videos Project](/files/1EjEM3oeNSS1g1bLnIhu)

![Videos Annotation Tool](/files/M1n3CxNwIUQwxuQZAudV)

### Step 2 — Trackers

Supervisely has **two types** of tracking algorithms:

1. **Predefined** — our base tracking solutions
2. **Apps** — custom tracking solutions

They become available when you select the annotated object.\
In this part, we will integrate our own tracker (**Apps**).

![Track Settings](/files/NjoDNwSW4Nbr3Pqkphl7)

### Step 3 — Creating the APP

**1. Add session tag to config**

In order for the Videos Annotator to see our application, we link it through the **sessions tags** space.\ <img src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png" alt="warning" data-size="line"> Only through the `sly_video_tracking` tag will Videos Annotator see our application. So:

**config.json (partially)**

```json
"session_tags": [
  "sly_video_tracking"
]
```

**2. Handle track command**

How to handle commands — [see here](https://github.com/supervisely-ecosystem/how-to-create-app/tree/master/chapter-03-ui/part-03-app-handlers#step-1--handle-html-events).\
The most important thing is to write a handler for the **track command**.

**src/main.py (partially)**

```python
@g.my_app.callback("track")
@sly.timeit
@send_error_data
def track(api: sly.Api, task_id, context, state, app_logger):
    tracker = TrackerContainer(context)
    tracker.track()
```

The OpenCV tracker logic is described [here](https://github.com/supervisely-ecosystem/how-to-create-app/blob/master/chapter-01-headless/part-05-integrate-to-videos-annotator/src/tracker.py#L42-L100).\
**You can replace it with your own code (your own tracker)**.

### Step 4 — Results

{% embed url="<https://www.youtube.com/watch?v=wtifCqfWY1g>" %}
Integrate custom tracker into Videos Annotation tool
{% endembed %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.supervisely.com/app-development/advanced/in-depth-app-development/chapter-1-headless/part-5-integrate-custom-tracker-into-videos-annotator-tool-opencv-tracker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
