pub struct Tracker { /* private fields */ }Implementations§
Source§impl Tracker
impl Tracker
Sourcepub fn new(config: TrackerConfig) -> Result<Self, TrackError>
pub fn new(config: TrackerConfig) -> Result<Self, TrackError>
Creates a tracker with validated configuration.
Sourcepub fn update(&mut self, detections: &[Detection]) -> Vec<TrackedDetection>
pub fn update(&mut self, detections: &[Detection]) -> Vec<TrackedDetection>
Updates tracker state for one frame and returns tracked detections.
For allocation-sensitive runtime loops, prefer Tracker::update_into
with a caller-owned output buffer that can be reused across frames.
Sourcepub fn update_into(
&mut self,
detections: &[Detection],
out: &mut Vec<TrackedDetection>,
)
pub fn update_into( &mut self, detections: &[Detection], out: &mut Vec<TrackedDetection>, )
Updates tracker state for one frame and writes tracked detections into out.
This API allows callers to reuse out across frames and avoid
allocating a fresh output vector for each update call.
Sourcepub fn active_tracks(&self) -> &[Track]
pub fn active_tracks(&self) -> &[Track]
Returns active tracks owned by this tracker.
Sourcepub fn count_by_class(&self, class_id: usize) -> usize
pub fn count_by_class(&self, class_id: usize) -> usize
Counts active tracks for the provided class id.
Sourcepub fn people_count(&self) -> usize
pub fn people_count(&self) -> usize
Counts active person-class tracks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tracker
impl RefUnwindSafe for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl UnsafeUnpin for Tracker
impl UnwindSafe for Tracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more