pub struct AnalyticsMeta {
pub nodes: Vec<AnalyticsNode>,
pub relations: Vec<Relation>,
pub class_names: Option<Arc<[Box<str>]>>,
}Expand description
The per-frame analytics relation graph (the GstAnalyticsRelationMeta
analog): typed detection / classification / tracking nodes plus directed
relations between them, so downstream elements (overlay, recorder, alarm)
read results by node kind and traversal instead of decoding raw tensors.
Fields§
§nodes: Vec<AnalyticsNode>§relations: Vec<Relation>§class_names: Option<Arc<[Box<str>]>>Class names indexed by a node’s label, so a consumer can show
“person” rather than 12. Shared rather than stored per node: the
names repeat on every detection of every frame, and a node stays
Copy. None means the producer published no table.
Implementations§
Source§impl AnalyticsMeta
impl AnalyticsMeta
pub fn new() -> Self
Sourcepub fn set_class_names<I, S>(&mut self, names: I)
pub fn set_class_names<I, S>(&mut self, names: I)
Set the class-name table, indexed by label id.
Sourcepub fn class_name(&self, label: u32) -> Option<&str>
pub fn class_name(&self, label: u32) -> Option<&str>
The name for a label id. None with no table, or for an id past its
end: that means the table and the producer disagree, and showing a
neighbour’s name would be worse than showing none.
Sourcepub fn push(&mut self, node: AnalyticsNode) -> usize
pub fn push(&mut self, node: AnalyticsNode) -> usize
Append a node, returning its index (used to wire relations).
Sourcepub fn add_detection(&mut self, detection: ObjectDetection) -> usize
pub fn add_detection(&mut self, detection: ObjectDetection) -> usize
Append a detection node, returning its index.
Sourcepub fn relate(&mut self, from: usize, to: usize, kind: RelationKind)
pub fn relate(&mut self, from: usize, to: usize, kind: RelationKind)
Wire a directed relation between two node indices.
Sourcepub fn detections(&self) -> impl Iterator<Item = &ObjectDetection>
pub fn detections(&self) -> impl Iterator<Item = &ObjectDetection>
Iterate the detection nodes.
Sourcepub fn segmentations(&self) -> impl Iterator<Item = &Segmentation>
pub fn segmentations(&self) -> impl Iterator<Item = &Segmentation>
Iterate the instance-segmentation nodes.
Trait Implementations§
Source§impl Clone for AnalyticsMeta
impl Clone for AnalyticsMeta
Source§fn clone(&self) -> AnalyticsMeta
fn clone(&self) -> AnalyticsMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnalyticsMeta
impl Debug for AnalyticsMeta
Source§impl Default for AnalyticsMeta
impl Default for AnalyticsMeta
Source§fn default() -> AnalyticsMeta
fn default() -> AnalyticsMeta
Source§impl FrameMeta for AnalyticsMeta
impl FrameMeta for AnalyticsMeta
Source§fn propagate(&self, transform: Transform) -> Propagation
fn propagate(&self, transform: Transform) -> Propagation
Normalized coordinates survive a scale / crop / copy unchanged; a re-encode to a compressed codec discards pixel-derived analytics.
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Source§fn clone_box(&self) -> Box<dyn FrameMeta>
fn clone_box(&self) -> Box<dyn FrameMeta>
copy_func analog. Backs
the copy-on-write of a shared meta when a tee branch mutates it (see
FrameMetaSet::get_mut); each FrameMeta impl is its own concrete
type, so the duplication can only be expressed on the trait.