#[non_exhaustive]pub struct ConfigOutputs {
pub outputs: Vec<ConfigOutput>,
pub nms: Option<Nms>,
pub nms_multi_label: Option<bool>,
pub decoder_version: Option<DecoderVersion>,
}Expand description
Used to represent the outputs in the model configuration.
§Examples
let config_json = std::fs::read_to_string("modelpack_split.json")?;
let config: ConfigOutputs = serde_json::from_str(&config_json)?;
let decoder = DecoderBuilder::new().with_config(config).build()?;
The struct is #[non_exhaustive] so new optional settings can be added
without a breaking change. Outside this crate, start from
ConfigOutputs::new (or Default, or a parser) and assign fields:
let mut config = ConfigOutputs::new(Vec::new());
config.nms = Some(Nms::ClassAgnostic);
assert!(config.nms_multi_label.is_none());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.outputs: Vec<ConfigOutput>§nms: Option<Nms>NMS mode from config file. When present, overrides the builder’s NMS setting.
Some(Nms::ClassAgnostic)— class-agnostic NMS: suppress overlapping boxes regardless of classSome(Nms::ClassAware)— class-aware NMS: only suppress boxes with the same classNone— use the builder default (Nms::Autoresolves to class-aware)
nms_multi_label: Option<bool>Emit one box per class above the score threshold (validation decode). Tracked decode ignores it; an explicit decoder setting overrides it.
decoder_version: Option<DecoderVersion>Decoder version for Ultralytics models. Determines the decoding strategy.
Some(Yolo26)— end-to-end model with embedded NMSSome(Yolov5/Yolov8/Yolo11)— traditional models requiring external NMSNone— infer from other settings (legacy behavior)
Implementations§
Source§impl ConfigOutputs
impl ConfigOutputs
Sourcepub fn new(outputs: Vec<ConfigOutput>) -> Self
pub fn new(outputs: Vec<ConfigOutput>) -> Self
A config with these outputs and every other setting unset.
Trait Implementations§
Source§impl Clone for ConfigOutputs
impl Clone for ConfigOutputs
Source§impl Debug for ConfigOutputs
impl Debug for ConfigOutputs
Source§impl Default for ConfigOutputs
impl Default for ConfigOutputs
Source§impl<'de> Deserialize<'de> for ConfigOutputs
impl<'de> Deserialize<'de> for ConfigOutputs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConfigOutputs
impl PartialEq for ConfigOutputs
Source§impl Serialize for ConfigOutputs
impl Serialize for ConfigOutputs
impl StructuralPartialEq for ConfigOutputs
Auto Trait Implementations§
impl Freeze for ConfigOutputs
impl RefUnwindSafe for ConfigOutputs
impl Send for ConfigOutputs
impl Sync for ConfigOutputs
impl Unpin for ConfigOutputs
impl UnsafeUnpin for ConfigOutputs
impl UnwindSafe for ConfigOutputs
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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