[−][src]Struct opencv::dnn::SegmentationModel
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
impl SegmentationModel
[src]
pub fn as_raw_SegmentationModel(&self) -> *const c_void
[src]
pub fn as_raw_mut_SegmentationModel(&mut self) -> *mut c_void
[src]
impl SegmentationModel
[src]
pub fn new(model: &str, config: &str) -> Result<SegmentationModel>
[src]
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: ""
pub fn new_1(network: &Net) -> Result<SegmentationModel>
[src]
Trait Implementations
impl Boxed for SegmentationModel
[src]
unsafe fn from_raw(ptr: *mut c_void) -> Self
[src]
fn into_raw(self) -> *mut c_void
[src]
fn as_raw(&self) -> *const c_void
[src]
fn as_raw_mut(&mut self) -> *mut c_void
[src]
impl Drop for SegmentationModel
[src]
impl ModelTrait for SegmentationModel
[src]
fn as_raw_Model(&self) -> *const c_void
[src]
fn as_raw_mut_Model(&mut self) -> *mut c_void
[src]
fn set_input_size(&mut self, size: Size) -> Result<Model>
[src]
fn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model>
[src]
fn set_input_mean(&mut self, mean: Scalar) -> Result<Model>
[src]
fn set_input_scale(&mut self, scale: f64) -> Result<Model>
[src]
fn set_input_crop(&mut self, crop: bool) -> Result<Model>
[src]
fn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model>
[src]
fn set_input_params(
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool
) -> Result<()>
[src]
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool
) -> Result<()>
fn predict(
&mut self,
frame: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
[src]
&mut self,
frame: &dyn ToInputArray,
outs: &mut dyn ToOutputArray
) -> Result<()>
impl NetTrait for SegmentationModel
[src]
fn as_raw_Net(&self) -> *const c_void
[src]
fn as_raw_mut_Net(&mut self) -> *mut c_void
[src]
fn empty(&self) -> Result<bool>
[src]
fn dump(&mut self) -> Result<String>
[src]
fn dump_to_file(&mut self, path: &str) -> Result<()>
[src]
fn add_layer(
&mut self,
name: &str,
typ: &str,
params: &mut LayerParams
) -> Result<i32>
[src]
&mut self,
name: &str,
typ: &str,
params: &mut LayerParams
) -> Result<i32>
fn add_layer_to_prev(
&mut self,
name: &str,
typ: &str,
params: &mut LayerParams
) -> Result<i32>
[src]
&mut self,
name: &str,
typ: &str,
params: &mut LayerParams
) -> Result<i32>
fn get_layer_id(&mut self, layer: &str) -> Result<i32>
[src]
fn get_layer_names(&self) -> Result<Vector<String>>
[src]
fn get_layer(&mut self, layer_id: Net_LayerId) -> Result<Ptr<Layer>>
[src]
fn get_layer_inputs(
&mut self,
layer_id: Net_LayerId
) -> Result<Vector<Ptr<Layer>>>
[src]
&mut self,
layer_id: Net_LayerId
) -> Result<Vector<Ptr<Layer>>>
fn connect_first_second(&mut self, out_pin: &str, inp_pin: &str) -> Result<()>
[src]
fn connect(
&mut self,
out_layer_id: i32,
out_num: i32,
inp_layer_id: i32,
inp_num: i32
) -> Result<()>
[src]
&mut self,
out_layer_id: i32,
out_num: i32,
inp_layer_id: i32,
inp_num: i32
) -> Result<()>
fn set_inputs_names(&mut self, input_blob_names: &Vector<String>) -> Result<()>
[src]
fn set_input_shape(&mut self, input_name: &str, shape: &MatShape) -> Result<()>
[src]
fn forward_single(&mut self, output_name: &str) -> Result<Mat>
[src]
fn forward_async(&mut self, output_name: &str) -> Result<AsyncArray>
[src]
fn forward_layer(
&mut self,
output_blobs: &mut dyn ToOutputArray,
output_name: &str
) -> Result<()>
[src]
&mut self,
output_blobs: &mut dyn ToOutputArray,
output_name: &str
) -> Result<()>
fn forward(
&mut self,
output_blobs: &mut dyn ToOutputArray,
out_blob_names: &Vector<String>
) -> Result<()>
[src]
&mut self,
output_blobs: &mut dyn ToOutputArray,
out_blob_names: &Vector<String>
) -> Result<()>
fn forward_and_retrieve(
&mut self,
output_blobs: &mut Vector<Vector<Mat>>,
out_blob_names: &Vector<String>
) -> Result<()>
[src]
&mut self,
output_blobs: &mut Vector<Vector<Mat>>,
out_blob_names: &Vector<String>
) -> Result<()>
fn set_halide_scheduler(&mut self, scheduler: &str) -> Result<()>
[src]
fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()>
[src]
fn set_preferable_target(&mut self, target_id: i32) -> Result<()>
[src]
fn set_input(
&mut self,
blob: &dyn ToInputArray,
name: &str,
scalefactor: f64,
mean: Scalar
) -> Result<()>
[src]
&mut self,
blob: &dyn ToInputArray,
name: &str,
scalefactor: f64,
mean: Scalar
) -> Result<()>
fn set_param(
&mut self,
layer: Net_LayerId,
num_param: i32,
blob: &Mat
) -> Result<()>
[src]
&mut self,
layer: Net_LayerId,
num_param: i32,
blob: &Mat
) -> Result<()>
fn get_param(&mut self, layer: Net_LayerId, num_param: i32) -> Result<Mat>
[src]
fn get_unconnected_out_layers(&self) -> Result<Vector<i32>>
[src]
fn get_unconnected_out_layers_names(&self) -> Result<Vector<String>>
[src]
fn get_layers_shapes(
&self,
net_input_shapes: &Vector<MatShape>,
layers_ids: &mut Vector<i32>,
in_layers_shapes: &mut Vector<Vector<MatShape>>,
out_layers_shapes: &mut Vector<Vector<MatShape>>
) -> Result<()>
[src]
&self,
net_input_shapes: &Vector<MatShape>,
layers_ids: &mut Vector<i32>,
in_layers_shapes: &mut Vector<Vector<MatShape>>,
out_layers_shapes: &mut Vector<Vector<MatShape>>
) -> Result<()>
fn get_layers_shapes_1(
&self,
net_input_shape: &MatShape,
layers_ids: &mut Vector<i32>,
in_layers_shapes: &mut Vector<Vector<MatShape>>,
out_layers_shapes: &mut Vector<Vector<MatShape>>
) -> Result<()>
[src]
&self,
net_input_shape: &MatShape,
layers_ids: &mut Vector<i32>,
in_layers_shapes: &mut Vector<Vector<MatShape>>,
out_layers_shapes: &mut Vector<Vector<MatShape>>
) -> Result<()>
fn get_layer_shapes(
&self,
net_input_shape: &MatShape,
layer_id: i32,
in_layer_shapes: &mut Vector<MatShape>,
out_layer_shapes: &mut Vector<MatShape>
) -> Result<()>
[src]
&self,
net_input_shape: &MatShape,
layer_id: i32,
in_layer_shapes: &mut Vector<MatShape>,
out_layer_shapes: &mut Vector<MatShape>
) -> Result<()>
fn get_layer_shapes_1(
&self,
net_input_shapes: &Vector<MatShape>,
layer_id: i32,
in_layer_shapes: &mut Vector<MatShape>,
out_layer_shapes: &mut Vector<MatShape>
) -> Result<()>
[src]
&self,
net_input_shapes: &Vector<MatShape>,
layer_id: i32,
in_layer_shapes: &mut Vector<MatShape>,
out_layer_shapes: &mut Vector<MatShape>
) -> Result<()>
fn get_flops(&self, net_input_shapes: &Vector<MatShape>) -> Result<i64>
[src]
fn get_flops_1(&self, net_input_shape: &MatShape) -> Result<i64>
[src]
fn get_flops_2(
&self,
layer_id: i32,
net_input_shapes: &Vector<MatShape>
) -> Result<i64>
[src]
&self,
layer_id: i32,
net_input_shapes: &Vector<MatShape>
) -> Result<i64>
fn get_flops_3(&self, layer_id: i32, net_input_shape: &MatShape) -> Result<i64>
[src]
fn get_layer_types(&self, layers_types: &mut Vector<String>) -> Result<()>
[src]
fn get_layers_count(&self, layer_type: &str) -> Result<i32>
[src]
fn get_memory_consumption(
&self,
net_input_shapes: &Vector<MatShape>,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
[src]
&self,
net_input_shapes: &Vector<MatShape>,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
fn get_memory_consumption_1(
&self,
net_input_shape: &MatShape,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
[src]
&self,
net_input_shape: &MatShape,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
fn get_memory_consumption_for_layer(
&self,
layer_id: i32,
net_input_shapes: &Vector<MatShape>,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
[src]
&self,
layer_id: i32,
net_input_shapes: &Vector<MatShape>,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
fn get_memory_consumption_2(
&self,
layer_id: i32,
net_input_shape: &MatShape,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
[src]
&self,
layer_id: i32,
net_input_shape: &MatShape,
weights: &mut size_t,
blobs: &mut size_t
) -> Result<()>
fn get_memory_consumption_for_layers(
&self,
net_input_shapes: &Vector<MatShape>,
layer_ids: &mut Vector<i32>,
weights: &mut Vector<size_t>,
blobs: &mut Vector<size_t>
) -> Result<()>
[src]
&self,
net_input_shapes: &Vector<MatShape>,
layer_ids: &mut Vector<i32>,
weights: &mut Vector<size_t>,
blobs: &mut Vector<size_t>
) -> Result<()>
fn get_memory_consumption_3(
&self,
net_input_shape: &MatShape,
layer_ids: &mut Vector<i32>,
weights: &mut Vector<size_t>,
blobs: &mut Vector<size_t>
) -> Result<()>
[src]
&self,
net_input_shape: &MatShape,
layer_ids: &mut Vector<i32>,
weights: &mut Vector<size_t>,
blobs: &mut Vector<size_t>
) -> Result<()>
fn enable_fusion(&mut self, fusion: bool) -> Result<()>
[src]
fn get_perf_profile(&mut self, timings: &mut Vector<f64>) -> Result<i64>
[src]
impl SegmentationModelTrait for SegmentationModel
[src]
fn as_raw_SegmentationModel(&self) -> *const c_void
[src]
fn as_raw_mut_SegmentationModel(&mut self) -> *mut c_void
[src]
fn segment(
&mut self,
frame: &dyn ToInputArray,
mask: &mut dyn ToOutputArray
) -> Result<()>
[src]
&mut self,
frame: &dyn ToInputArray,
mask: &mut dyn ToOutputArray
) -> Result<()>
impl Send for SegmentationModel
[src]
Auto Trait Implementations
impl RefUnwindSafe for SegmentationModel
impl !Sync for SegmentationModel
impl Unpin for SegmentationModel
impl UnwindSafe for SegmentationModel
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,