pub struct Detections {
pub boxes: Vec<BoundingBox>,
pub scores: Vec<f32>,
pub labels: Vec<u32>,
}Expand description
Detection boxes with per-box confidence and label —
std/vision/v1/Detections.
Fields§
§boxes: Vec<BoundingBox>The boxes.
scores: Vec<f32>The per-box confidences, index-aligned with boxes.
labels: Vec<u32>The per-box class labels, index-aligned with boxes.
Implementations§
Source§impl Detections
impl Detections
Sourcepub fn new(
boxes: Vec<BoundingBox>,
scores: Vec<f32>,
labels: Vec<u32>,
) -> Result<Self>
pub fn new( boxes: Vec<BoundingBox>, scores: Vec<f32>, labels: Vec<u32>, ) -> Result<Self>
Detections whose three lists are the same length.
§Errors
DataError::ColumnLengthMismatch when they are not.
Sourcepub fn check_alignment(&self) -> Result<()>
pub fn check_alignment(&self) -> Result<()>
Checks that the three index-aligned lists agree on length.
§Errors
DataError::ColumnLengthMismatch naming the first list that
disagrees.
Trait Implementations§
Source§impl AstrsMessage for Detections
impl AstrsMessage for Detections
Source§const URN: &'static str = "std/vision/v1/Detections"
const URN: &'static str = "std/vision/v1/Detections"
The type URN this message’s columnar layout is declared against
(blueprint §24.3), e.g.
"std/vision/v1/Detections".Source§fn data_type() -> DataType
fn data_type() -> DataType
The columnar layout
AstrsMessage::to_record_batch produces and
AstrsMessage::from_record_batch expects.Source§fn to_record_batch(&self) -> Result<RecordBatch>
fn to_record_batch(&self) -> Result<RecordBatch>
Encodes one message into a one-row
RecordBatch (blueprint §6.1’s
“one record batch per message”). Read moreSource§fn from_record_batch(batch: &RecordBatch) -> Result<Self>
fn from_record_batch(batch: &RecordBatch) -> Result<Self>
Decodes one message from a one-row
RecordBatch. Read moreSource§fn schema() -> Schema
fn schema() -> Schema
The single-column
Schema wrapping AstrsMessage::data_type
under crate::DATA_COLUMN (blueprint §6.1).Source§fn type_urn() -> Result<TypeUrn, TypeUrnError>
fn type_urn() -> Result<TypeUrn, TypeUrnError>
Parses
AstrsMessage::URN. Read moreSource§impl Clone for Detections
impl Clone for Detections
Source§impl Debug for Detections
impl Debug for Detections
Source§impl Default for Detections
impl Default for Detections
Source§impl FromPayload for Detections
impl FromPayload for Detections
Source§fn from_batch(batch: &RecordBatch) -> Result<Self>
fn from_batch(batch: &RecordBatch) -> Result<Self>
Reads the value from a decoded payload batch. Read more
Source§impl PartialEq for Detections
impl PartialEq for Detections
impl StructuralPartialEq for Detections
Auto Trait Implementations§
impl Freeze for Detections
impl RefUnwindSafe for Detections
impl Send for Detections
impl Sync for Detections
impl Unpin for Detections
impl UnsafeUnpin for Detections
impl UnwindSafe for Detections
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more