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: MonotonicTsTimestamp of this observation.
bbox: BBoxBounding box in normalized coordinates.
confidence: f32Confidence score for this observation.
state: TrackStateTrack 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: TypedMetadataExtensible 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
impl TrackObservation
Sourcepub fn new(
ts: MonotonicTs,
bbox: BBox,
confidence: f32,
state: TrackState,
detection_id: Option<DetectionId>,
) -> Self
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
impl Clone for TrackObservation
Source§fn clone(&self) -> TrackObservation
fn clone(&self) -> TrackObservation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more