#[non_exhaustive]pub struct SemanticOptions {
pub mode: Option<DecodeMode>,
pub letterbox: Option<[f32; 4]>,
}Expand description
Runtime options of one semantic decode.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: Option<DecodeMode>Decode mode; None uses the model’s default.
letterbox: Option<[f32; 4]>Image content within the model input as normalized
[xmin, ymin, xmax, ymax], as produced by a letterbox resize. The
region is cropped and stretched over the whole class map. None
means the image fills the input.
Implementations§
Source§impl SemanticOptions
impl SemanticOptions
Sourcepub fn with_mode(self, mode: DecodeMode) -> Self
pub fn with_mode(self, mode: DecodeMode) -> Self
Overrides the model’s decode mode.
Sourcepub fn with_letterbox(self, letterbox: [f32; 4]) -> Self
pub fn with_letterbox(self, letterbox: [f32; 4]) -> Self
Sets the letterbox content region.
Trait Implementations§
Source§impl Clone for SemanticOptions
impl Clone for SemanticOptions
impl Copy for SemanticOptions
Source§impl Debug for SemanticOptions
impl Debug for SemanticOptions
Source§impl Default for SemanticOptions
impl Default for SemanticOptions
Source§impl PartialEq for SemanticOptions
impl PartialEq for SemanticOptions
impl StructuralPartialEq for SemanticOptions
Auto Trait Implementations§
impl Freeze for SemanticOptions
impl RefUnwindSafe for SemanticOptions
impl Send for SemanticOptions
impl Sync for SemanticOptions
impl Unpin for SemanticOptions
impl UnsafeUnpin for SemanticOptions
impl UnwindSafe for SemanticOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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