#[repr(u32)]pub enum DecoderVersion {
Yolov5 = 0,
Yolov8 = 1,
Yolo11 = 2,
Yolo26 = 3,
}Expand description
Decoder version for Ultralytics models.
Specifies the YOLO architecture version, which determines the decoding strategy:
Yolov5,Yolov8,Yolo11: Traditional models requiring external NMSYolo26: End-to-end models with NMS embedded in the model architecture
When decoder_version is set to Yolo26, the decoder uses end-to-end
model types regardless of the nms setting.
The code is the one the Python DecoderVersion enum uses.
Variants§
Yolov5 = 0
YOLOv5 - anchor-free DFL decoder, requires external NMS
Yolov8 = 1
YOLOv8 - anchor-free DFL decoder, requires external NMS
Yolo11 = 2
YOLO11 - anchor-free DFL decoder, requires external NMS
Yolo26 = 3
YOLO26 - end-to-end model with embedded NMS (one-to-one matching heads)
Implementations§
Source§impl DecoderVersion
impl DecoderVersion
Sourcepub const fn code(self) -> u32
pub const fn code(self) -> u32
The shared code for this variant. Identical on every surface.
const, deliberately: a downstream binding that cannot
write Variant = OtherEnum::Variant.code() in a #[pyclass]
discriminant position (PyO3 requires a literal there) can
still pin that literal to this value with a
const _: () = assert!(...) – a build-time check instead
of a hand-synced comment. See PyTensorMemory/PyPixelFormat
in crates/python-common/src/tensor.rs for the consumer.
Sourcepub fn from_code(code: u32) -> Option<Self>
pub fn from_code(code: u32) -> Option<Self>
Reject an unknown code rather than guessing at one.
Sourcepub fn from_str_code(s: &str) -> Option<Self>
pub fn from_str_code(s: &str) -> Option<Self>
Reject an unknown string rather than guessing at one.
Source§impl DecoderVersion
impl DecoderVersion
Sourcepub fn is_end_to_end(&self) -> bool
pub fn is_end_to_end(&self) -> bool
Returns true if this version uses end-to-end inference (embedded NMS).
Trait Implementations§
Source§impl Clone for DecoderVersion
impl Clone for DecoderVersion
impl Copy for DecoderVersion
Source§impl Debug for DecoderVersion
impl Debug for DecoderVersion
Source§impl<'de> Deserialize<'de> for DecoderVersion
impl<'de> Deserialize<'de> for DecoderVersion
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>,
impl Eq for DecoderVersion
Source§impl Hash for DecoderVersion
impl Hash for DecoderVersion
Source§impl PartialEq for DecoderVersion
impl PartialEq for DecoderVersion
Source§impl Serialize for DecoderVersion
impl Serialize for DecoderVersion
impl StructuralPartialEq for DecoderVersion
Auto Trait Implementations§
impl Freeze for DecoderVersion
impl RefUnwindSafe for DecoderVersion
impl Send for DecoderVersion
impl Sync for DecoderVersion
impl Unpin for DecoderVersion
impl UnsafeUnpin for DecoderVersion
impl UnwindSafe for DecoderVersion
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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