pub struct TensorMeta(/* private fields */);Expand description
The inference outputs attached to a frame, for the elements that keep the
picture on the wire instead of replacing it with the tensor. That is what
lets inference -> post-process -> overlay stay one straight chain: the
frame reaching the overlay is still the video the model saw.
Holds every tensor on the frame, since a FrameMetaSet keys by concrete
type and would otherwise let a second model’s output replace the first.
These are not detections; those are the post-processor’s AnalyticsMeta.
Implementations§
Source§impl TensorMeta
impl TensorMeta
Sourcepub fn push(&mut self, tensor: NamedTensor)
pub fn push(&mut self, tensor: NamedTensor)
Add one output, replacing any earlier tensor of the same name so a re-run of the same stage updates rather than accumulates.
Sourcepub fn iter(&self) -> impl Iterator<Item = &NamedTensor>
pub fn iter(&self) -> impl Iterator<Item = &NamedTensor>
Every attached tensor, in the order the stages produced them.
Sourcepub fn get(&self, name: &str) -> Option<&NamedTensor>
pub fn get(&self, name: &str) -> Option<&NamedTensor>
The tensor named name.
Sourcepub fn only(&self) -> Option<&NamedTensor>
pub fn only(&self) -> Option<&NamedTensor>
The tensor when the frame carries exactly one, so the ordinary
single-model pipeline needs no names. None when there are several:
the consumer must then say which it wants rather than be handed an
arbitrary one.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for TensorMeta
impl Clone for TensorMeta
Source§fn clone(&self) -> TensorMeta
fn clone(&self) -> TensorMeta
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 TensorMeta
impl Debug for TensorMeta
Source§impl Default for TensorMeta
impl Default for TensorMeta
Source§fn default() -> TensorMeta
fn default() -> TensorMeta
Source§impl FrameMeta for TensorMeta
impl FrameMeta for TensorMeta
Source§fn propagate(&self, transform: Transform) -> Propagation
fn propagate(&self, transform: Transform) -> Propagation
The tensors describe the picture the models saw, so a re-encode ends their usefulness the way it ends an analytics graph’s. A scale or crop leaves them readable: what they mean is fixed by the model input size the post-processor normalizes against, not the frame’s current size.
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.