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
sourceimpl 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
sourceimpl Boxed for DetectionModel
impl Boxed for DetectionModel
sourceimpl DetectionModelTrait for DetectionModel
impl DetectionModelTrait for DetectionModel
fn as_raw_mut_DetectionModel(&mut self) -> *mut c_void
sourcefn 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
sourcefn 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 Read more
sourceimpl DetectionModelTraitConst for DetectionModel
impl DetectionModelTraitConst for DetectionModel
fn as_raw_DetectionModel(&self) -> *const c_void
sourceimpl Drop for DetectionModel
impl Drop for DetectionModel
sourceimpl From<DetectionModel> for Model
impl From<DetectionModel> for Model
sourcefn from(s: DetectionModel) -> Self
fn from(s: DetectionModel) -> Self
Converts to this type from the input type.
sourceimpl ModelTrait for DetectionModel
impl ModelTrait for DetectionModel
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 DetectionModel
impl ModelTraitConst for DetectionModel
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 DetectionModel
Auto Trait Implementations
impl RefUnwindSafe for DetectionModel
impl !Sync for DetectionModel
impl Unpin for DetectionModel
impl UnwindSafe for DetectionModel
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