pub struct YoloModelSession {
pub session: Session,
pub labels: Vec<ArcStr>,
pub probability_threshold: Option<f32>,
pub iou_threshold: Option<f32>,
}Expand description
The YOLO model.
It is a wrapper around the ONNX runtime session and the YOLO labels.
Fields§
§session: Session§labels: Vec<ArcStr>§probability_threshold: Option<f32>§iou_threshold: Option<f32>Implementations§
Source§impl YoloModelSession
impl YoloModelSession
Sourcepub fn new(
session: Session,
labels: impl Iterator<Item = impl Into<ArcStr>>,
) -> Self
pub fn new( session: Session, labels: impl Iterator<Item = impl Into<ArcStr>>, ) -> Self
Wrap a ONNX session to a YoloModelSession.
The session is the ONNX runtime session, and the labels are the YOLO labels.
Sourcepub fn new_v8(session: Session) -> Self
pub fn new_v8(session: Session) -> Self
Wrap a ONNX session to a YoloModelSession based on the labels of YOLO v8 (v11).
Sourcepub fn from_filename_v8(filename: impl AsRef<Path>) -> Result<Self, YoloError>
pub fn from_filename_v8(filename: impl AsRef<Path>) -> Result<Self, YoloError>
Load the YOLO ONNX model from a filename.
You can use this function to load a YOLO v8 (v11) model from a file.
The filename is the path to the ONNX model file.
You can export the ONNX model file according to Ultralytics’ manual.
pub fn get_labels(&self) -> &[ArcStr]
pub fn get_probability_threshold(&self) -> f32
pub fn get_iou_threshold(&self) -> f32
Trait Implementations§
Source§impl AsMut<Session> for YoloModelSession
impl AsMut<Session> for YoloModelSession
Source§impl AsRef<Session> for YoloModelSession
impl AsRef<Session> for YoloModelSession
Auto Trait Implementations§
impl Freeze for YoloModelSession
impl !RefUnwindSafe for YoloModelSession
impl Send for YoloModelSession
impl Sync for YoloModelSession
impl Unpin for YoloModelSession
impl UnsafeUnpin for YoloModelSession
impl !UnwindSafe for YoloModelSession
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
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