pub struct ByteTracker { /* private fields */ }Expand description
ByteTrack multi-object tracker with stable IDs.
Accepts external detections each frame and returns the active tracked set. Does not run inference or decode video.
Implementations§
Source§impl ByteTracker
impl ByteTracker
Sourcepub fn new(config: ByteTrackConfig) -> Result<Self, TrackError>
pub fn new(config: ByteTrackConfig) -> Result<Self, TrackError>
Creates a tracker from a validated configuration.
§Errors
Returns TrackError::InvalidConfig when thresholds are invalid.
Sourcepub const fn config(&self) -> ByteTrackConfig
pub const fn config(&self) -> ByteTrackConfig
Returns the current configuration.
Sourcepub const fn frame_id(&self) -> u64
pub const fn frame_id(&self) -> u64
Internal frame counter after the last Self::update.
Sourcepub fn snapshot(&self) -> TrackerSnapshot
pub fn snapshot(&self) -> TrackerSnapshot
Captures a full runtime snapshot for checkpointing.
Sourcepub fn restore(&mut self, snapshot: TrackerSnapshot)
pub fn restore(&mut self, snapshot: TrackerSnapshot)
Restores counters and track list from a snapshot (config unchanged).
Sourcepub fn from_snapshot(
config: ByteTrackConfig,
snapshot: TrackerSnapshot,
) -> Result<Self, TrackError>
pub fn from_snapshot( config: ByteTrackConfig, snapshot: TrackerSnapshot, ) -> Result<Self, TrackError>
Sourcepub fn update(
&mut self,
detections: &[Detection],
) -> Result<Vec<Detection>, TrackError>
pub fn update( &mut self, detections: &[Detection], ) -> Result<Vec<Detection>, TrackError>
Updates the tracker with one frame of detections.
Assigns track_id on the returned detections for matched/activated
objects. Input order of returned detections follows the active track
list (tracked and new), not the original detection order.
§Errors
Returns TrackError::NonFinite only if internal assumptions break;
detections are expected to already be validated by sightloom-core.