pub enum ModelSource {
Onnx,
TfLite,
CoreMl,
Other,
}Expand description
Container format of the model the signals were read from. Drives Ultralytics per-format conventions (box normalization, tensor order).
Variants§
Onnx
An ONNX export. Ultralytics emits pixel-space box coordinates here,
so the inferred schema sets normalized: false.
TfLite
A TFLite/LiteRT export. Ultralytics emits boxes normalized to
[0, 1] here, so the inferred schema sets normalized: true.
CoreMl
A CoreML export (.mlpackage / .mlmodelc). Ultralytics’ CoreML
converter traces the same graph the ONNX exporter traces — the
1/w normalize lives only in IOSDetectModel, which is used
solely on the nms=True pipeline path — so a no-NMS export emits
pixel-space box coordinates and the inferred schema sets
normalized: false, matching ModelSource::Onnx.
Established by source-tracing the Ultralytics exporter and
confirmed by runtime magnitude measurement against a matched fp16
ONNX pair; testdata/infer/NOTES.md records the reasoning, the
measurement and the captured fixture.
This resolution covers the no-NMS export only. A nms=True export
runs Apple’s NMS pipeline (image/iouThreshold/
confidenceThreshold inputs, dynamically-shaped confidence/
coordinates outputs) — a different artifact entirely, not the
anchor-grid tensor this resolution reasons about. Inference does
not classify it as a schema: neither output’s shape can match the
[1, 4+nc, A] anchor-grid layout this module looks for.
Other
Any other container. Inference refuses this with
InferError::UnknownBoxConvention rather than assuming a box
convention: whether coordinates are pixel-space or [0, 1] follows
the exporter, is not derivable from tensor shapes, and getting it
wrong scales every box by the input size. The variant exists so a
signal collector can report honestly what it read; add a measured
container here rather than routing it through Other.
Trait Implementations§
Source§impl Clone for ModelSource
impl Clone for ModelSource
Source§fn clone(&self) -> ModelSource
fn clone(&self) -> ModelSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ModelSource
Source§impl Debug for ModelSource
impl Debug for ModelSource
impl Eq for ModelSource
Source§impl PartialEq for ModelSource
impl PartialEq for ModelSource
impl StructuralPartialEq for ModelSource
Auto Trait Implementations§
impl Freeze for ModelSource
impl RefUnwindSafe for ModelSource
impl Send for ModelSource
impl Sync for ModelSource
impl Unpin for ModelSource
impl UnsafeUnpin for ModelSource
impl UnwindSafe for ModelSource
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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