pub struct CoreMLRequest { /* private fields */ }Available on crate feature
coreml only.Expand description
A dedicated VNCoreMLRequest wrapper.
Implementations§
Source§impl CoreMLRequest
impl CoreMLRequest
pub fn new(model_path: impl AsRef<Path>) -> Self
pub fn with_model(self, model: CoreMLModel) -> Self
pub const fn with_image_based_request( self, image_based: ImageBasedRequest, ) -> Self
pub const fn with_image_crop_and_scale_option( self, image_crop_and_scale_option: CoreMLImageCropAndScaleOption, ) -> Self
pub const fn image_based_request(&self) -> &ImageBasedRequest
pub const fn image_crop_and_scale_option(&self) -> CoreMLImageCropAndScaleOption
pub const fn model(&self) -> &CoreMLModel
Sourcepub fn classify(
&self,
image_path: impl AsRef<Path>,
) -> Result<Vec<Classification>, VisionError>
pub fn classify( &self, image_path: impl AsRef<Path>, ) -> Result<Vec<Classification>, VisionError>
Run the request as a classifier and return VNClassificationObservation
values.
§Errors
Returns VisionError if the image/model cannot be loaded or Vision
rejects the request.
Sourcepub fn feature_value(
&self,
image_path: impl AsRef<Path>,
) -> Result<Option<CoreMLFeatureValueObservation>, VisionError>
pub fn feature_value( &self, image_path: impl AsRef<Path>, ) -> Result<Option<CoreMLFeatureValueObservation>, VisionError>
Run the request and return a dedicated
VNCoreMLFeatureValueObservation.
§Errors
Returns VisionError if the image/model cannot be loaded or Vision
rejects the request.
Trait Implementations§
Source§impl Clone for CoreMLRequest
impl Clone for CoreMLRequest
Source§fn clone(&self) -> CoreMLRequest
fn clone(&self) -> CoreMLRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CoreMLRequest
impl Debug for CoreMLRequest
Source§impl PartialEq for CoreMLRequest
impl PartialEq for CoreMLRequest
Source§fn eq(&self, other: &CoreMLRequest) -> bool
fn eq(&self, other: &CoreMLRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CoreMLRequest
Auto Trait Implementations§
impl Freeze for CoreMLRequest
impl RefUnwindSafe for CoreMLRequest
impl Send for CoreMLRequest
impl Sync for CoreMLRequest
impl Unpin for CoreMLRequest
impl UnsafeUnpin for CoreMLRequest
impl UnwindSafe for CoreMLRequest
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