Struct opencv::dnn::DetectionModel
source · pub struct DetectionModel { /* private fields */ }
Expand description
This class represents high-level API for object detection networks.
DetectionModel allows to set params for preprocessing input image. DetectionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return result detections. For DetectionModel SSD, Faster R-CNN, YOLO topologies are supported.
Implementations§
source§impl DetectionModel
impl DetectionModel
sourcepub fn new(model: &str, config: &str) -> Result<DetectionModel>
pub fn new(model: &str, config: &str) -> Result<DetectionModel>
Create detection 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<DetectionModel>
pub fn new_1(network: &Net) -> Result<DetectionModel>
pub fn default() -> Result<DetectionModel>
Trait Implementations§
source§impl Boxed for DetectionModel
impl Boxed for DetectionModel
source§impl Clone for DetectionModel
impl Clone for DetectionModel
source§impl Debug for DetectionModel
impl Debug for DetectionModel
source§impl DetectionModelTrait for DetectionModel
impl DetectionModelTrait for DetectionModel
fn as_raw_mut_DetectionModel(&mut self) -> *mut c_void
source§fn set_nms_across_classes(&mut self, value: bool) -> Result<DetectionModel>
fn set_nms_across_classes(&mut self, value: bool) -> Result<DetectionModel>
nmsAcrossClasses defaults to false,
such that when non max suppression is used during the detect() function, it will do so per-class.
This function allows you to toggle this behaviour. Read more
source§fn get_nms_across_classes(&mut self) -> Result<bool>
fn get_nms_across_classes(&mut self) -> Result<bool>
Getter for nmsAcrossClasses. This variable defaults to false,
such that when non max suppression is used during the detect() function, it will do so only per-class
source§impl DetectionModelTraitConst for DetectionModel
impl DetectionModelTraitConst for DetectionModel
fn as_raw_DetectionModel(&self) -> *const c_void
source§impl Drop for DetectionModel
impl Drop for DetectionModel
source§impl From<DetectionModel> for Model
impl From<DetectionModel> for Model
source§fn from(s: DetectionModel) -> Self
fn from(s: DetectionModel) -> Self
Converts to this type from the input type.
source§impl ModelTrait for DetectionModel
impl ModelTrait for DetectionModel
fn as_raw_mut_Model(&mut self) -> *mut c_void
source§fn 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
source§fn 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
source§fn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
fn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
Set scalefactor value for frame. Read more
source§fn 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
source§fn 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>
source§impl ModelTraitConst for DetectionModel
impl ModelTraitConst for DetectionModel
fn as_raw_Model(&self) -> *const c_void
source§fn predict(
&self,
frame: &impl ToInputArray,
outs: &mut impl ToOutputArray
) -> Result<()>
fn predict( &self, frame: &impl ToInputArray, outs: &mut impl 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 DetectionModel
Auto Trait Implementations§
impl RefUnwindSafe for DetectionModel
impl !Sync for DetectionModel
impl Unpin for DetectionModel
impl UnwindSafe for DetectionModel
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