pub struct DetectBox {
pub bbox: BoundingBox,
pub score: f32,
pub label: usize,
}Expand description
A detection box with f32 bbox and score
Fields§
§bbox: BoundingBox§score: f32model-specific score for this detection, higher implies more confidence
label: usizelabel index for this detection
Implementations§
Source§impl DetectBox
impl DetectBox
Sourcepub fn equal_within_delta(&self, rhs: &DetectBox, eps: f32) -> bool
pub fn equal_within_delta(&self, rhs: &DetectBox, eps: f32) -> bool
Returns true if one detect box is equal to another detect box, within
the given eps
§Examples
let box1 = DetectBox {
bbox: edgefirst_decoder::BoundingBox {
xmin: 0.1,
ymin: 0.2,
xmax: 0.3,
ymax: 0.4,
},
score: 0.5,
label: 1,
};
let box2 = DetectBox {
bbox: edgefirst_decoder::BoundingBox {
xmin: 0.101,
ymin: 0.199,
xmax: 0.301,
ymax: 0.399,
},
score: 0.510,
label: 1,
};
assert!(box1.equal_within_delta(&box2, 0.011));Trait Implementations§
impl Copy for DetectBox
impl StructuralPartialEq for DetectBox
Auto Trait Implementations§
impl Freeze for DetectBox
impl RefUnwindSafe for DetectBox
impl Send for DetectBox
impl Sync for DetectBox
impl Unpin for DetectBox
impl UnsafeUnpin for DetectBox
impl UnwindSafe for DetectBox
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more