pub trait ModelTrait: ModelTraitConst {
Show 16 methods
// Required method
fn as_raw_mut_Model(&mut self) -> *mut c_void;
// Provided methods
fn set(&mut self, unnamed: &impl ModelTraitConst) { ... }
fn set_1(&mut self, unnamed: Model) { ... }
fn set_input_size(&mut self, size: Size) -> Result<Model> { ... }
fn set_input_size_1(&mut self, width: i32, height: i32) -> Result<Model> { ... }
fn set_input_mean(&mut self, mean: Scalar) -> Result<Model> { ... }
fn set_input_scale(&mut self, scale: Scalar) -> Result<Model> { ... }
fn set_input_crop(&mut self, crop: bool) -> Result<Model> { ... }
fn set_input_swap_rb(&mut self, swap_rb: bool) -> Result<Model> { ... }
fn set_output_names(&mut self, out_names: &Vector<String>) -> Result<Model> { ... }
fn set_input_params(
&mut self,
scale: f64,
size: Size,
mean: Scalar,
swap_rb: bool,
crop: bool,
) -> Result<()> { ... }
fn set_input_params_def(&mut self) -> Result<()> { ... }
fn set_preferable_backend(&mut self, backend_id: Backend) -> Result<Model> { ... }
fn set_preferable_target(&mut self, target_id: Target) -> Result<Model> { ... }
fn enable_winograd(&mut self, use_winograd: bool) -> Result<Model> { ... }
fn get_network__1(&mut self) -> Result<Net> { ... }
}
Expand description
Mutable methods for crate::dnn::Model
Required Methods§
fn as_raw_mut_Model(&mut self) -> *mut c_void
Provided Methods§
fn set(&mut self, unnamed: &impl ModelTraitConst)
fn set_1(&mut self, unnamed: Model)
Sourcefn set_input_size(&mut self, size: Size) -> Result<Model>
fn set_input_size(&mut self, size: Size) -> Result<Model>
Set input size for frame.
§Parameters
- size: New input size.
Note: If shape of the new blob less than 0, then frame size not change.
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.
§Parameters
- mean: Scalar with mean values which are subtracted from channels.
Sourcefn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
fn set_input_scale(&mut self, scale: Scalar) -> Result<Model>
Sourcefn set_input_crop(&mut self, crop: bool) -> Result<Model>
fn set_input_crop(&mut self, crop: bool) -> Result<Model>
Set flag crop for frame.
§Parameters
- crop: Flag which indicates whether image will be cropped after resize or not.
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.
§Parameters
- swapRB: Flag which indicates that swap first and last channels.
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.
§Parameters
- size: New input size.
- mean: Scalar with mean values which are subtracted from channels.
- scale: Multiplier for frame values.
- swapRB: Flag which indicates that swap first and last channels.
- crop: Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
§C++ default parameters
- scale: 1.0
- size: Size()
- mean: Scalar()
- swap_rb: false
- crop: false
Sourcefn set_input_params_def(&mut self) -> Result<()>
fn set_input_params_def(&mut self) -> Result<()>
Set preprocessing parameters for frame.
§Parameters
- size: New input size.
- mean: Scalar with mean values which are subtracted from channels.
- scale: Multiplier for frame values.
- swapRB: Flag which indicates that swap first and last channels.
- crop: Flag which indicates whether image will be cropped after resize or not. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
§Note
This alternative version of ModelTrait::set_input_params function uses the following default values for its arguments:
- scale: 1.0
- size: Size()
- mean: Scalar()
- swap_rb: false
- crop: false
Sourcefn set_preferable_backend(&mut self, backend_id: Backend) -> Result<Model>
fn set_preferable_backend(&mut self, backend_id: Backend) -> Result<Model>
§See also
Net::setPreferableBackend
Sourcefn set_preferable_target(&mut self, target_id: Target) -> Result<Model>
fn set_preferable_target(&mut self, target_id: Target) -> Result<Model>
§See also
Net::setPreferableTarget
Sourcefn enable_winograd(&mut self, use_winograd: bool) -> Result<Model>
fn enable_winograd(&mut self, use_winograd: bool) -> Result<Model>
§See also
Net::enableWinograd
fn get_network__1(&mut self) -> Result<Net>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.