Struct opencv::dnn::ClassificationModel
source · [−]pub struct ClassificationModel { /* private fields */ }
Expand description
This class represents high-level API for classification models.
ClassificationModel allows to set params for preprocessing input image. ClassificationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return top-1 prediction.
Implementations
sourceimpl ClassificationModel
impl ClassificationModel
pub fn default() -> Result<ClassificationModel>
sourcepub fn new(model: &str, config: &str) -> Result<ClassificationModel>
pub fn new(model: &str, config: &str) -> Result<ClassificationModel>
Create classification model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.
Parameters
- model: Binary file contains trained weights.
- config: Text file contains network configuration.
C++ default parameters
- config: “”
sourcepub fn new_1(network: &Net) -> Result<ClassificationModel>
pub fn new_1(network: &Net) -> Result<ClassificationModel>
Trait Implementations
sourceimpl Boxed for ClassificationModel
impl Boxed for ClassificationModel
sourceimpl ClassificationModelTrait for ClassificationModel
impl ClassificationModelTrait for ClassificationModel
fn as_raw_mut_ClassificationModel(&mut self) -> *mut c_void
sourcefn set_enable_softmax_post_processing(
&mut self,
enable: bool
) -> Result<ClassificationModel>
fn set_enable_softmax_post_processing(
&mut self,
enable: bool
) -> Result<ClassificationModel>
Set enable/disable softmax post processing option. Read more
sourceimpl ClassificationModelTraitConst for ClassificationModel
impl ClassificationModelTraitConst for ClassificationModel
fn as_raw_ClassificationModel(&self) -> *const c_void
sourcefn get_enable_softmax_post_processing(&self) -> Result<bool>
fn get_enable_softmax_post_processing(&self) -> Result<bool>
Get enable/disable softmax post processing option. Read more
sourceimpl Drop for ClassificationModel
impl Drop for ClassificationModel
sourceimpl From<ClassificationModel> for Model
impl From<ClassificationModel> for Model
sourcefn from(s: ClassificationModel) -> Self
fn from(s: ClassificationModel) -> Self
Converts to this type from the input type.
sourceimpl ModelTrait for ClassificationModel
impl ModelTrait for ClassificationModel
fn as_raw_mut_Model(&mut self) -> *mut c_void
sourcefn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model>
fn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model>
Set input size for frame. Read more
sourcefn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
Set mean value for frame. Read more
sourcefn set_input_scale(&mut self, scale: f64) -> Result<Model>
fn set_input_scale(&mut self, scale: f64) -> Result<Model>
Set scalefactor value for frame. Read more
sourcefn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model>
fn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model>
Set flag swapRB for frame. Read more
sourcefn set_input_params(
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool
) -> Result<()>
fn set_input_params(
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool
) -> Result<()>
Set preprocessing parameters for frame. Read more
fn get_network__1(&mut self) -> Result<Net>
sourceimpl ModelTraitConst for ClassificationModel
impl ModelTraitConst for ClassificationModel
fn as_raw_Model(&self) -> *const c_void
sourcefn predict(
&self,
frame: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
fn predict(
&self,
frame: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
Given the @p input frame, create input blob, run net and return the output @p blobs. Read more
fn get_network_(&self) -> Result<Net>
impl Send for ClassificationModel
Auto Trait Implementations
impl RefUnwindSafe for ClassificationModel
impl !Sync for ClassificationModel
impl Unpin for ClassificationModel
impl UnwindSafe for ClassificationModel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more