Docs /Templates/ sinapsis-supervision

ByteTrack

sinapsis-supervisionByteTrack

Python template · sinapsis_supervision.templates.byte_track

Overview

A template class for implementing the ByteTrack tracking algorithm.

This class provides functionality to track objects across frames using the ByteTrack algorithm. It handles the conversion of annotations to detections, updates tracks, and converts detections back to annotations.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-supervision==1.0.0
uv pip install sinapsis-supervision==1.0.0
uv add sinapsis-supervision==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
frame_rate

The frame rate of the video.

float | int
Optional
Default: 30
lost_track_buffer

Number of frames to buffer when a track is lost. Increasing lost_track_buffer enhances occlusion handling, significantly reducing the likelihood of track fragmentation or disappearance caused by brief detection gaps.

int
Optional
Default: 30
minimum_consecutive_frames

Number of consecutive frames that an object must be tracked before it is considered a 'valid' track. Increasing minimum_consecutive_frames prevents the creation of accidental tracks from false detection or double detection, but risks missing shorter tracks.

int
Optional
Default: 1
minimum_matching_threshold

Threshold for matching tracks with detections. Increasing minimum_matching_threshold improves accuracy but risks fragmentation. Decreasing it improves completeness but risks false positives and drift.

float
Optional
Default: 0.7
track_activation_threshold

Detection confidence threshold for track activation. Increasing track_activation_threshold improves accuracy and stability but might miss true detections. Decreasing it increases completeness but risks introducing noise and instability.

float
Optional
Default: 0.2

Configuration example

Example from the Python docstring:

yaml
agent:
    name: my_test_agent
templates:
-   template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}
-   template_name: ByteTrack
    class_name: ByteTrack
    template_input: InputTemplate
    attributes:
        track_activation_threshold: 0.2
        lost_track_buffer: 30
        minimum_matching_threshold: 0.5
        frame_rate: 30
        minimum_consecutive_frames: 1
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "ByteTrack"
    class_name: "ByteTrack"
    attributes:
      frame_rate: 30
      lost_track_buffer: 30
      minimum_consecutive_frames: 1
      minimum_matching_threshold: 0.7
      track_activation_threshold: 0.2

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.