Struct opencv::dnn::SegmentationModel
source · pub struct SegmentationModel { /* private fields */ }
Expand description
This class represents high-level API for segmentation models
SegmentationModel allows to set params for preprocessing input image. SegmentationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the class prediction for each pixel.
Implementations§
source§impl SegmentationModel
impl SegmentationModel
sourcepub fn new(model: &str, config: &str) -> Result<SegmentationModel>
pub fn new(model: &str, config: &str) -> Result<SegmentationModel>
Create segmentation 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<SegmentationModel>
pub fn new_1(network: &Net) -> Result<SegmentationModel>
Trait Implementations§
source§impl Boxed for SegmentationModel
impl Boxed for SegmentationModel
source§impl Drop for SegmentationModel
impl Drop for SegmentationModel
source§impl From<SegmentationModel> for Model
impl From<SegmentationModel> for Model
source§fn from(s: SegmentationModel) -> Self
fn from(s: SegmentationModel) -> Self
Converts to this type from the input type.
source§impl ModelTrait for SegmentationModel
impl ModelTrait for SegmentationModel
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: f64) -> Result<Model>
fn set_input_scale(&mut self, scale: f64) -> 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 SegmentationModel
impl ModelTraitConst for SegmentationModel
fn as_raw_Model(&self) -> *const c_void
source§fn 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>
source§impl SegmentationModelTrait for SegmentationModel
impl SegmentationModelTrait for SegmentationModel
fn as_raw_mut_SegmentationModel(&mut self) -> *mut c_void
source§fn segment(
&mut self,
frame: &dyn ToInputArray,
mask: &mut dyn ToOutputArray
) -> Result<()>
fn segment( &mut self, frame: &dyn ToInputArray, mask: &mut dyn ToOutputArray ) -> Result<()>
Given the @p input frame, create input blob, run net Read more