Skip to main content

Detection

Struct Detection 

Source
pub struct Detection {
    pub bbox: Option<BoundingBox>,
    pub class_label: String,
    pub confidence: f32,
    pub track_id: Option<u64>,
    pub assoc_confidence: Option<f32>,
    pub lock_state: Option<LockState>,
    pub attributes: Option<BTreeMap<String, Value>>,
    pub mask: Option<Vec<[f32; 2]>>,
    pub keypoints: Option<Vec<Keypoint>>,
    pub depth: Option<f32>,
    pub world_pos: Option<[f64; 3]>,
}
Expand description

One percept from a model: the self-describing per-frame unit a consumer reads. It began as a 2D box and grows by ADDING typed optional fields (each serde-default + skipped when absent), so a producer emits only what it measured and an older producer/reader round-trips unchanged. The 2D box is itself now optional: a box detector always sets it, while a box-less percept (a segmentation mask, a pose, a depth-only reading) may omit it and carry its geometry in the typed fields below.

Fields§

§bbox: Option<BoundingBox>

The 2D bounding box in the frame’s own pixel resolution. Some for the common box detector (always set before box-less percepts existed, so an older producer’s payload still decodes to Some); None for a box-less percept. Skipped on the wire when absent.

§class_label: String§confidence: f32§track_id: Option<u64>

Stable track id across frames (tracking models only).

§assoc_confidence: Option<f32>

How confident the tracker is that this detection is the same object as its track_id (0..1). None when the source does not score association (e.g. a stateless detector). Distinct from confidence, which scores the class/object detection itself.

§lock_state: Option<LockState>

Discrete lock state of the track’s identity this frame. None when the source does not report a lock state.

§attributes: Option<BTreeMap<String, Value>>

Open, self-describing per-detection attributes: the extension point for richer perception a model may carry beyond the 2D box — a segmentation mask reference, keypoints, a depth estimate, a world-frame position — as well as any model-specific metadata, keyed by name. A concrete primitive promotes to its own typed field once a consumer needs it as first-class; until then it rides here so the contract extends without a schema change. Absent (skipped on the wire) when the source reports none.

§mask: Option<Vec<[f32; 2]>>

Segmentation mask as a polygon of (x, y) vertices tracing the object outline, in the frame’s own pixel resolution. None when the source reports no mask.

§keypoints: Option<Vec<Keypoint>>

Keypoints (pose joints or landmarks) for this detection, in frame pixels. None when the source reports none.

§depth: Option<f32>

Estimated distance from the camera to the detection, in metres. None when the source reports no depth.

§world_pos: Option<[f64; 3]>

The detection’s position in a world frame, as a bare 3-array so the frame convention can evolve without a schema change: local ENU metres [x, y, z], or geographic [lat, lon, alt] once a producer geolocates. None when the source reports no world position.

Trait Implementations§

Source§

impl Clone for Detection

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 Detection

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Detection

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Detection

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Detection

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Detection

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more