Object tracking

Learn how to track objects across video frames using degirum_tools.ObjectTracker. This guide explains how to assign persistent IDs to detections, reduce flicker, and extract motion-based analytics.

Estimated read time: 2 minutes

Object detection gives you bounding boxes per frame, but it doesn’t tell you which box in frame t corresponds to which one in frame t+1.

Tracking links detections over time, assigning stable IDs so you can reduce flicker, handle brief occlusions, and compute per-object metrics like entries/exits, speed, or dwell time.

It’s essential for analytics like lane counts, zone crossings, or any logic that relies on tracking the same object across frames.

Tracker and analyzers

Video feed of traffic with an object tracker analyzer tracking cars.
Video feed of traffic with an object tracker analyzer tracking cars.

Attach the built-in tracker to assign persistent IDs, smooth detections, and enable downstream analytics like entries, exits, or dwell time. Use the references below for deeper configuration guidance.

Example

  • Attaching the analyzer: degirum_tools.attach_analyzers(model, [tracker]) registers the tracker with the model. After this, each inference result is passed through the tracker to maintain IDs and draw trails.

  • anchor_point: Controls where the trail connects to each detection box (e.g., BOTTOM_CENTER). Choose a point that best represents object motion (BOTTOM_CENTER is a good default for vehicles or people on the ground).

  • class_list: Limits tracking to specific labels (e.g., ["car"]). Set to None to track all classes, or provide multiple labels like ["car", "bus", "truck"].

Last updated

Was this helpful?