Skip to main content

TrackObservation

Struct TrackObservation 

Source
pub struct TrackObservation {
    pub ts: MonotonicTs,
    pub bbox: BBox,
    pub confidence: f32,
    pub state: TrackState,
    pub detection_id: Option<DetectionId>,
    pub metadata: TypedMetadata,
}
Expand description

One observation of a track in a single frame.

Records the spatial and temporal state at the moment of observation.

§Per-observation metadata

The metadata field allows stages to attach arbitrary per-observation data: embeddings, model-specific scores, attention weights, or feature vectors. This is especially useful for joint detection+tracking models that produce tracks directly (without an intermediate DetectionSet) and need somewhere to store per-observation features.

When metadata is unused (the common case for classical trackers), the field is zero-cost — TypedMetadata::new() does not allocate. If storing large data (e.g., a full feature map), wrap it in Arc<T> to keep clone costs low.

Fields§

§ts: MonotonicTs

Timestamp of this observation.

§bbox: BBox

Bounding box in normalized coordinates.

§confidence: f32

Confidence score for this observation.

§state: TrackState

Track state at time of observation.

§detection_id: Option<DetectionId>

The detection that was associated with this track, if any. None when the track is coasting (no matching detection), or when the track was produced by a joint model that does not generate intermediate detections.

§metadata: TypedMetadata

Extensible per-observation metadata.

Stages can store embeddings, features, model-specific scores, or any Clone + Send + Sync + 'static data here. The field is zero-cost when empty (no heap allocation until first insert).

Implementations§

Source§

impl TrackObservation

Source

pub fn new( ts: MonotonicTs, bbox: BBox, confidence: f32, state: TrackState, detection_id: Option<DetectionId>, ) -> Self

Create a new observation with optional detection association.

Metadata starts empty. Attach per-observation data (embeddings, features, etc.) by setting the public metadata field after construction.

Trait Implementations§

Source§

impl Clone for TrackObservation

Source§

fn clone(&self) -> TrackObservation

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TrackObservation

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.