DeepSORTTrackerInference
Python template · sinapsis_rf_trackers.templates.deepsort_tracker_inference
Overview
This template provides the logic to use the DeepSORT tracker from Roboflow's trackers library. It enhances the basic SORT tracking by incorporating appearance features, making it more robust for challenging tracking scenarios with occlusions and crowded scenes.
Key Features: - Appearance-based re-identification using deep features - Reduced identity switches compared to motion-only trackers - Configurable appearance and motion feature weighting - Support for various CNN backbones via timm library
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-rf-trackers==1.0.0uv pip install sinapsis-rf-trackers==1.0.0uv add sinapsis-rf-trackers==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: 30
Device to run the Re-ID model on. 'auto' selects CUDA if available. Defaults to "auto".
Optional
Default: "auto"
Additional keyword arguments to pass to the Re-ID model constructor.
Optional
Default: null
Optional
Default: null
Optional
Default: "/home/ariel/.cache/sinapsis"
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Distance metric for appearance feature comparison. Supported metrics include 'cosine' and 'euclidean'. Cosine distance is generally more robust for appearance features. Defaults to "cosine".
Optional
Default: "cosine"
Name of the feature extraction model from timm or a path to a checkpoint. Defaults to "tf_efficientnet_b1.in1k".
Optional
Default: "tf_efficientnet_b1.in1k"
Weight of appearance features versus motion features in the association cost. Higher values prioritize appearance matching, lower values prioritize motion consistency. Defaults to 0.5.
Optional
Default: 0.5
Optional
Default: 30
Threshold for appearance-based matching. Higher values make the tracker more conservative in appearance matching, reducing identity switches but potentially losing tracks during occlusions. Defaults to 0.7.
Optional
Default: 0.7
Optional
Default: 0.3
Whether to use pooled features from the Re-ID model. Defaults to True.
Optional
Default: true
Optional
Default: 3
Optional
Default: 0.25
Configuration example
Example from the Python docstring:
agent:
name: deepsort_tracker_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: DeepSORTTrackerInference
class_name: DeepSORTTrackerInference
template_input: InputTemplate
attributes:
track_activation_threshold: 0.25
lost_track_buffer: 30
minimum_consecutive_frames: 3
minimum_iou_threshold: 0.3
frame_rate: 30
appearance_threshold: 0.7
appearance_weight: 0.5
distance_metric: "cosine"
reid_model_name: "tf_efficientnet_b1.in1k"
reid_device: "auto"Show schema-based configuration skeleton
templates:
- template_name: "DeepSORTTrackerInference"
class_name: "DeepSORTTrackerInference"
attributes:
frame_rate: 30
reid_device: "auto"
reid_kwargs:
no_jit: null
cache_dir: "/home/ariel/.cache/sinapsis"
exportable: null
scriptable: null
pretrained_cfg: null
checkpoint_path: null
pretrained_cfg_overlay: null
distance_metric: "cosine"
reid_model_name: "tf_efficientnet_b1.in1k"
appearance_weight: 0.5
lost_track_buffer: 30
appearance_threshold: 0.7
minimum_iou_threshold: 0.3
reid_get_pooled_features: true
minimum_consecutive_frames: 3
track_activation_threshold: 0.25
Inheritance
sinapsis_rf_trackers.templates.rf_tracker_base.RFTrackerBaseEnvironment variables
Environment definitions belong to their canonical Python modules.