pub trait ClassificationModelTrait: ClassificationModelTraitConst + ModelTrait {
    // Required method
    fn as_raw_mut_ClassificationModel(&mut self) -> *mut c_void;

    // Provided methods
    fn set_enable_softmax_post_processing(
        &mut self,
        enable: bool
    ) -> Result<ClassificationModel> { ... }
    fn classify(&mut self, frame: &dyn ToInputArray) -> Result<Tuple<(i32, f32)>> { ... }
    fn classify_1(
        &mut self,
        frame: &dyn ToInputArray,
        class_id: &mut i32,
        conf: &mut f32
    ) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::dnn::ClassificationModel

Required Methods§

Provided Methods§

source

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.
source

fn classify(&mut self, frame: &dyn ToInputArray) -> Result<Tuple<(i32, f32)>>

Given the @p input frame, create input blob, run net and return top-1 prediction.

Parameters
  • frame: The input image.
source

fn classify_1( &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.
Overloaded parameters

Implementors§