Skip to main content

Tracker

Trait Tracker 

Source
pub trait Tracker<T: DetectionBox> {
    // Required methods
    fn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>;
    fn get_active_tracks(&self) -> Vec<ActiveTrackInfo<T>>;
}
Expand description

Multi-object tracker interface.

Implementations associate a stream of per-frame detection boxes into persistent tracks. The tracker owns all internal state (tracklet filters, timestamps, IDs) and is mutable — update takes &mut self.

§Contract

  • The returned Vec from update is parallel to the input boxes slice: result[i] is Some(info) when detection i was matched to a track or spawned a new one, and None when it was too low-confidence to initiate or continue a track.
  • get_active_tracks returns every tracklet that has not yet expired, including those not matched in the most recent frame (they remain alive until extra_lifespan elapses without a match).
  • Callers must not share a single Tracker across concurrent threads without external synchronization — update takes &mut self.

Required Methods§

Source

fn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>

Process one frame of detections and advance all internal tracklet states.

boxes is the set of detections for this frame. timestamp is a monotonically increasing value (typically nanoseconds from a wall clock or pipeline counter) used for tracklet expiry.

Returns a Vec<Option<TrackInfo>> of the same length as boxes.

Source

fn get_active_tracks(&self) -> Vec<ActiveTrackInfo<T>>

Return all currently active tracklets, including those not matched in the most recent frame but not yet expired.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> Tracker<T> for ByteTrack<T>
where T: DetectionBox,