Trait opencv::hub_prelude::ClassificationModelTrait
source · [−]pub trait ClassificationModelTrait: ClassificationModelTraitConst + ModelTrait {
fn as_raw_mut_ClassificationModel(&mut self) -> *mut c_void;
fn set_enable_softmax_post_processing(
&mut self,
enable: bool
) -> Result<ClassificationModel> { ... }
fn classify(
&mut self,
frame: &dyn ToInputArray,
class_id: &mut i32,
conf: &mut f32
) -> Result<()> { ... }
}
Required Methods
fn as_raw_mut_ClassificationModel(&mut self) -> *mut c_void
Provided Methods
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.
If this option is true, softmax is applied after forward inference within the classify() function to convert the confidences range to [0.0-1.0]. This function allows you to toggle this behavior. Please turn true when not contain softmax layer in model.
Parameters
- enable: Set enable softmax post processing within the classify() function.
sourcefn classify(
&mut self,
frame: &dyn ToInputArray,
class_id: &mut i32,
conf: &mut f32
) -> Result<()>
fn classify(
&mut self,
frame: &dyn ToInputArray,
class_id: &mut i32,
conf: &mut f32
) -> Result<()>
Given the @p input frame, create input blob, run net and return top-1 prediction.
Parameters
- frame: The input image.