Skip to main content
Object tracking is a post-processing layer that follows detected objects across video frames and gives each one a persistent ID. It turns per-frame bounding boxes into stable tracks, which reduces jitter and lets you count objects, measure dwell time, or trigger an event when something crosses a line. Object tracking works for models trained in Edge Impulse and models uploaded through Bring your own model (BYOM), and runs on-device in your deployment.
The Post-processing page with SORT tracking and its parameters on the left, and a drone video playing on the right where each parked car keeps its track ID as the camera moves and newly visible cars get new IDs.

Object tracking overview

How object tracking works

An object detection model looks at every frame in isolation. Object tracking adds continuity: each frame, the tracker matches new detections to the objects it is already following. A matched object keeps its ID and its track is updated. An unmatched detection starts a new track. A track that goes unmatched for too long is closed.

Choosing a tracking algorithm

Edge Impulse provides two tracking algorithms. Neither is better for every scene, so start from how your objects move: If you’re not sure, upload a few videos from your deployment environment and render a preview with each algorithm. See tuning the tracker.
How SORT tracking worksSORT (Simple Online and Realtime Tracking) is a general-purpose tracking algorithm introduced by Bewley et al. in 2016. For each new frame, the tracker:
  1. Predicts where each tracked object should be, using a Kalman filter that estimates its position, size, and velocity.
  2. Matches new detections to those predictions using bounding box overlap (IoU) and an optimal assignment step. Detections only match tracks with the same label.
  3. Updates matched tracks with the new detection, so each motion estimate keeps adapting as the object changes speed or direction.
  4. Starts a track for every unmatched detection and closes tracks that go unmatched for longer than Max age frames.
A new track is only reported once it has been matched in Min hits consecutive frames, which filters out one-off false detections. A track is only reported in frames where it matches a detection. While it waits for a match, it keeps its ID but is not included in the output. SORT matches on position and motion alone and does not run a second neural network for appearance features, so its computational overhead stays low.

Configuring object tracking

Object tracking is available in any object detection project. You’ll find it under Post-processing in the left navigation bar.
The Studio left navigation bar with the Post-processing item highlighted under the impulse section.

Post-processing in the navigation bar

Uploading videos

To configure object tracking, upload one or more videos of representative scenes, for example a video of your production line if you want to track products on a conveyor belt. These videos do not need labels. Frames are squashed before running inference. For the most representative results, crop your video to the aspect ratio of your impulse input. For example, if your model input is 320x320, crop your video to a square before uploading. To upload videos, go to Data acquisition > Post-processing and click the upload icon. Most common video formats are supported, up to 100 MB per file.
The Data acquisition page with the Post-processing tab selected, showing three uploaded drone videos, the upload icon in the Dataset card header, and a preview of the selected video.

Tuning the tracker

Go to Post-processing in the left navigation bar. Under Object tracking, select an algorithm from the dropdown:
  • Simple Online and Realtime Tracking (SORT), marked as recommended in object detection projects.
  • Linear Tracking.
  • Disabled, to deploy without object tracking.
Then tune the parameters, click Save, and click Render preview to see the tracks on your post-processing videos. You can also show the raw bounding box predictions to compare the tracker’s output with your model’s. The first render takes a little longer, and the results are cached so later renders are faster.
The Post-processing page with Simple Online and Realtime Tracking (SORT) selected and its parameters on the left, and a rendered preview on the right where six parked cars each carry a track ID.
Set the parameters for the frame rate your deployed device will run at. If you tune on a 30 fps video, run your device at 30 fps too, because parameters such as Max age are counted in frames.

SORT tracking parameters

Linear tracking parameters

For bounding box models, both IoU threshold and Threshold compare bounding box overlap the same way:
Pairs of overlapping bounding boxes at increasing IoU values, from barely touching to almost fully overlapping.

Configuring object tracking with the API

You can also select the algorithm and set its parameters with the Set post-processing block config endpoint. Set type to sort-object-tracking or object-tracking to switch algorithms. Parameters are passed as strings, for example:

Deploying your model

Once object tracking is configured, every deployment that contains an object detection block includes the tracker automatically, including the Linux EIM, mobile, C++ library, and WebAssembly targets.

Changing tracking parameters at runtime

You can change the tracking parameters of a deployed model without rebuilding it. The parameter names depend on the algorithm:

Linux CLI

Run edge-impulse-linux-runner --model-file <model.eim>. Click the gear icon in the web UI (http://localhost:PORT) to change the tracking parameters. To override the thresholds, start the runner with your parameters. e.g_._--thresholds 3.min_score=0.7,236.iou_threshold=0.1,236.max_age=5,236.min_hits=5

Mobile client

When you run your impulse in the Edge Impulse mobile client, click the gear icon to change the tracking parameters.
Animation of the mobile client's settings panel, where the tracking parameters are changed and the bounding boxes update live.

Node.js SDK

Call setLearnBlockThreshold on the runner with the ID of the post-processing block and the parameters to change. The runner’s model information lists each block’s ID and current values under thresholds.

C++ library

The C++ library stores the tracking configuration in model-parameters/model_variables.h. With SORT tracking, it looks like this:
With linear tracking, the struct is ei_object_tracking_config_t with keep_grace, max_observations, and threshold fields instead. To change a value at runtime, call set_threshold_postprocessing with the post-processing block, the parameter name, and the new value.

Comparing object tracking with standard object detection

To see the difference between raw and tracked bounding boxes, run a model with and without object tracking side by side:
Two side-by-side video feeds: raw detections flicker between frames on the left, while tracked boxes stay stable with persistent IDs on the right.
In one terminal, run the model with object tracking:
In a second terminal, run the model without object tracking:
Open http://localhost:9200 and http://localhost:9201 in two browser windows. The bounding boxes are smoother and more persistent with object tracking enabled.

Reading tracked objects from the inference output

C++ library

WebAssembly

EIM files

When you read inference results from an EIM file, tracked objects are under the object_tracking field.

Advanced usage

For a more complex example, see the model cascade approach, which chains an object tracking model with an LLM:

Troubleshooting

If you run into issues with object tracking, ask on the Edge Impulse forum or contact your solutions engineer.