Skip to main content

ByteTracker

Struct ByteTracker 

Source
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

Source

pub fn new(config: ByteTrackConfig) -> Result<Self, TrackError>

Creates a tracker from a validated configuration.

§Errors

Returns TrackError::InvalidConfig when thresholds are invalid.

Source

pub const fn config(&self) -> ByteTrackConfig

Returns the current configuration.

Source

pub fn tracks(&self) -> &[Track]

Returns all non-removed tracks.

Source

pub const fn frame_id(&self) -> u64

Internal frame counter after the last Self::update.

Source

pub const fn next_id(&self) -> u32

Next local track id that will be assigned.

Source

pub fn snapshot(&self) -> TrackerSnapshot

Captures a full runtime snapshot for checkpointing.

Source

pub fn restore(&mut self, snapshot: TrackerSnapshot)

Restores counters and track list from a snapshot (config unchanged).

Source

pub fn from_snapshot( config: ByteTrackConfig, snapshot: TrackerSnapshot, ) -> Result<Self, TrackError>

Restores a tracker from a snapshot and validated config.

§Errors

Returns config validation errors.

Source

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.

Trait Implementations§

Source§

impl Clone for ByteTracker

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ByteTracker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.