#[non_exhaustive]pub struct ResolvedModelConfig {
pub schema: SchemaV2,
pub labels: Vec<String>,
pub family: ModelFamily,
pub task: ModelTask,
pub decode_mode: Option<DecodeMode>,
pub preprocessing: PreprocessSpec,
pub provenance: BTreeMap<ConfigField, Provenance>,
pub description: String,
pub notes: Vec<String>,
pub reduce_labels: Option<bool>,
}Expand description
A model’s configuration as resolved from every source.
preprocessing and
decode_mode are authoritative; schema carries a
copy of them for consumers that read the schema alone.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.schema: SchemaV2The output schema, with input.preprocessing filled with the
resolved values when the schema has an input.
labels: Vec<String>Class names in channel order, with outer whitespace trimmed; empty when no source names them.
family: ModelFamilyThe family the configuration identifies.
task: ModelTaskWhat the outputs decode to.
decode_mode: Option<DecodeMode>The semantic decode mode, for semantic models.
preprocessing: PreprocessSpecThe input preprocessing of the reference pipeline. Its
interpolation may be one the image crate runs as bilinear
(Interpolation::supported); a note says so.
provenance: BTreeMap<ConfigField, Provenance>Where each value came from.
description: StringA one-line summary of the model.
notes: Vec<String>Deviations and skipped files worth logging.
reduce_labels: Option<bool>Hugging Face do_reduce_labels: the reference dataset drops its
background class and shifts the rest down. Exposed, not applied.
Implementations§
Source§impl ResolvedModelConfig
impl ResolvedModelConfig
Sourcepub fn source(&self, field: ConfigField) -> Option<&Provenance>
pub fn source(&self, field: ConfigField) -> Option<&Provenance>
Where field came from.
Sourcepub fn describe(&self) -> Vec<String>
pub fn describe(&self) -> Vec<String>
One key=value [source] line per resolved value, for logging. Lines
whose key is an override (normalize, resize, task, decode)
print the value in the override grammar, e.g.
resize=letterbox-topleft [preprocessor_config.json] or
normalize=imagenet [guess: SegFormer default].
Trait Implementations§
Source§impl Clone for ResolvedModelConfig
impl Clone for ResolvedModelConfig
Source§impl Debug for ResolvedModelConfig
impl Debug for ResolvedModelConfig
Source§impl PartialEq for ResolvedModelConfig
impl PartialEq for ResolvedModelConfig
impl StructuralPartialEq for ResolvedModelConfig
Auto Trait Implementations§
impl Freeze for ResolvedModelConfig
impl RefUnwindSafe for ResolvedModelConfig
impl Send for ResolvedModelConfig
impl Sync for ResolvedModelConfig
impl Unpin for ResolvedModelConfig
impl UnsafeUnpin for ResolvedModelConfig
impl UnwindSafe for ResolvedModelConfig
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
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> ⓘ
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> ⓘ
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