Struct opencv::dnn::BlankLayer
source · pub struct BlankLayer { /* private fields */ }
Expand description
§Partial List of Implemented Layers
This subsection of dnn module contains information about built-in layers and their descriptions.
Classes listed here, in fact, provides C++ API for creating instances of built-in layers. In addition to this way of layers instantiation, there is a more common factory API (see [dnnLayerFactory]), it allows to create layers dynamically (by name) and register new ones. You can use both API, but factory API is less convenient for native C++ programming and basically designed for use inside importers (see readNetFromCaffe, readNetFromTorch, readNetFromTensorflow).
Built-in layers partially reproduce functionality of corresponding Caffe and Torch7 layers. In particular, the following layers and Caffe importer were tested to reproduce Caffe functionality:
- Convolution
- Deconvolution
- Pooling
- InnerProduct
- TanH, ReLU, Sigmoid, BNLL, Power, AbsVal
- Softmax
- Reshape, Flatten, Slice, Split
- LRN
- MVN
- Dropout (since it does nothing on forward pass -))
Implementations§
source§impl BlankLayer
impl BlankLayer
Trait Implementations§
source§impl AlgorithmTrait for BlankLayer
impl AlgorithmTrait for BlankLayer
source§impl AlgorithmTraitConst for BlankLayer
impl AlgorithmTraitConst for BlankLayer
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
source§impl BlankLayerTrait for BlankLayer
impl BlankLayerTrait for BlankLayer
fn as_raw_mut_BlankLayer(&mut self) -> *mut c_void
source§impl BlankLayerTraitConst for BlankLayer
impl BlankLayerTraitConst for BlankLayer
fn as_raw_BlankLayer(&self) -> *const c_void
source§impl Boxed for BlankLayer
impl Boxed for BlankLayer
source§unsafe fn from_raw(ptr: <BlankLayer as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <BlankLayer as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <BlankLayer as OpenCVTypeExternContainer>::ExternSendMut
source§impl Debug for BlankLayer
impl Debug for BlankLayer
source§impl Drop for BlankLayer
impl Drop for BlankLayer
source§impl From<BlankLayer> for Algorithm
impl From<BlankLayer> for Algorithm
source§fn from(s: BlankLayer) -> Self
fn from(s: BlankLayer) -> Self
source§impl From<BlankLayer> for Layer
impl From<BlankLayer> for Layer
source§fn from(s: BlankLayer) -> Self
fn from(s: BlankLayer) -> Self
source§impl LayerTrait for BlankLayer
impl LayerTrait for BlankLayer
fn as_raw_mut_Layer(&mut self) -> *mut c_void
source§fn set_blobs(&mut self, val: Vector<Mat>)
fn set_blobs(&mut self, val: Vector<Mat>)
source§fn set_name(&mut self, val: &str)
fn set_name(&mut self, val: &str)
source§fn set_type(&mut self, val: &str)
fn set_type(&mut self, val: &str)
source§fn set_preferable_target(&mut self, val: i32)
fn set_preferable_target(&mut self, val: i32)
source§fn finalize(
&mut self,
inputs: &impl ToInputArray,
outputs: &mut impl ToOutputArray
) -> Result<()>
fn finalize( &mut self, inputs: &impl ToInputArray, outputs: &mut impl ToOutputArray ) -> Result<()>
source§fn forward_mat(
&mut self,
input: &mut Vector<Mat>,
output: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
fn forward_mat( &mut self, input: &mut Vector<Mat>, output: &mut Vector<Mat>, internals: &mut Vector<Mat> ) -> Result<()>
source§fn forward(
&mut self,
inputs: &impl ToInputArray,
outputs: &mut impl ToOutputArray,
internals: &mut impl ToOutputArray
) -> Result<()>
fn forward( &mut self, inputs: &impl ToInputArray, outputs: &mut impl ToOutputArray, internals: &mut impl ToOutputArray ) -> Result<()>
source§fn try_quantize(
&mut self,
scales: &Vector<Vector<f32>>,
zeropoints: &Vector<Vector<i32>>,
params: &mut impl LayerParamsTrait
) -> Result<bool>
fn try_quantize( &mut self, scales: &Vector<Vector<f32>>, zeropoints: &Vector<Vector<i32>>, params: &mut impl LayerParamsTrait ) -> Result<bool>
source§fn forward_fallback(
&mut self,
inputs: &impl ToInputArray,
outputs: &mut impl ToOutputArray,
internals: &mut impl ToOutputArray
) -> Result<()>
fn forward_fallback( &mut self, inputs: &impl ToInputArray, outputs: &mut impl ToOutputArray, internals: &mut impl ToOutputArray ) -> Result<()>
source§fn finalize_mat_to(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>
) -> Result<()>
fn finalize_mat_to( &mut self, inputs: &Vector<Mat>, outputs: &mut Vector<Mat> ) -> Result<()>
source§fn finalize_mat(&mut self, inputs: &Vector<Mat>) -> Result<Vector<Mat>>
fn finalize_mat(&mut self, inputs: &Vector<Mat>) -> Result<Vector<Mat>>
source§fn run(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
fn run( &mut self, inputs: &Vector<Mat>, outputs: &mut Vector<Mat>, internals: &mut Vector<Mat> ) -> Result<()>
source§fn input_name_to_index(&mut self, input_name: &str) -> Result<i32>
fn input_name_to_index(&mut self, input_name: &str) -> Result<i32>
source§fn output_name_to_index(&mut self, output_name: &str) -> Result<i32>
fn output_name_to_index(&mut self, output_name: &str) -> Result<i32>
source§fn support_backend(&mut self, backend_id: i32) -> Result<bool>
fn support_backend(&mut self, backend_id: i32) -> Result<bool>
source§fn init_halide(
&mut self,
inputs: &Vector<Ptr<BackendWrapper>>
) -> Result<Ptr<BackendNode>>
fn init_halide( &mut self, inputs: &Vector<Ptr<BackendWrapper>> ) -> Result<Ptr<BackendNode>>
fn init_ngraph( &mut self, inputs: &Vector<Ptr<BackendWrapper>>, nodes: &Vector<Ptr<BackendNode>> ) -> Result<Ptr<BackendNode>>
fn init_vk_com( &mut self, inputs: &Vector<Ptr<BackendWrapper>>, outputs: &mut Vector<Ptr<BackendWrapper>> ) -> Result<Ptr<BackendNode>>
fn init_webnn( &mut self, inputs: &Vector<Ptr<BackendWrapper>>, nodes: &Vector<Ptr<BackendNode>> ) -> Result<Ptr<BackendNode>>
source§unsafe fn init_cuda(
&mut self,
context: *mut c_void,
inputs: &Vector<Ptr<BackendWrapper>>,
outputs: &Vector<Ptr<BackendWrapper>>
) -> Result<Ptr<BackendNode>>
unsafe fn init_cuda( &mut self, context: *mut c_void, inputs: &Vector<Ptr<BackendWrapper>>, outputs: &Vector<Ptr<BackendWrapper>> ) -> Result<Ptr<BackendNode>>
source§unsafe fn init_tim_vx(
&mut self,
tim_vx_info: *mut c_void,
inputs_wrapper: &Vector<Ptr<BackendWrapper>>,
outputs_wrapper: &Vector<Ptr<BackendWrapper>>,
is_last: bool
) -> Result<Ptr<BackendNode>>
unsafe fn init_tim_vx( &mut self, tim_vx_info: *mut c_void, inputs_wrapper: &Vector<Ptr<BackendWrapper>>, outputs_wrapper: &Vector<Ptr<BackendWrapper>>, is_last: bool ) -> Result<Ptr<BackendNode>>
source§fn init_cann(
&mut self,
inputs: &Vector<Ptr<BackendWrapper>>,
outputs: &Vector<Ptr<BackendWrapper>>,
nodes: &Vector<Ptr<BackendNode>>
) -> Result<Ptr<BackendNode>>
fn init_cann( &mut self, inputs: &Vector<Ptr<BackendWrapper>>, outputs: &Vector<Ptr<BackendWrapper>>, nodes: &Vector<Ptr<BackendNode>> ) -> Result<Ptr<BackendNode>>
source§fn try_attach(&mut self, node: &Ptr<BackendNode>) -> Result<Ptr<BackendNode>>
fn try_attach(&mut self, node: &Ptr<BackendNode>) -> Result<Ptr<BackendNode>>
source§fn set_activation(&mut self, layer: &Ptr<ActivationLayer>) -> Result<bool>
fn set_activation(&mut self, layer: &Ptr<ActivationLayer>) -> Result<bool>
source§fn try_fuse(&mut self, top: &mut Ptr<Layer>) -> Result<bool>
fn try_fuse(&mut self, top: &mut Ptr<Layer>) -> Result<bool>
source§fn unset_attached(&mut self) -> Result<()>
fn unset_attached(&mut self) -> Result<()>
fn update_memory_shapes(&mut self, inputs: &Vector<MatShape>) -> Result<bool>
fn set_params_from(&mut self, params: &impl LayerParamsTraitConst) -> Result<()>
source§impl LayerTraitConst for BlankLayer
impl LayerTraitConst for BlankLayer
fn as_raw_Layer(&self) -> *const c_void
source§fn blobs(&self) -> Vector<Mat>
fn blobs(&self) -> Vector<Mat>
source§fn name(&self) -> String
fn name(&self) -> String
source§fn preferable_target(&self) -> i32
fn preferable_target(&self) -> i32
source§fn apply_halide_scheduler(
&self,
node: &mut Ptr<BackendNode>,
inputs: &Vector<Mat>,
outputs: &Vector<Mat>,
target_id: i32
) -> Result<()>
fn apply_halide_scheduler( &self, node: &mut Ptr<BackendNode>, inputs: &Vector<Mat>, outputs: &Vector<Mat>, target_id: i32 ) -> Result<()>
source§fn get_scale_shift(
&self,
scale: &mut impl MatTrait,
shift: &mut impl MatTrait
) -> Result<()>
fn get_scale_shift( &self, scale: &mut impl MatTrait, shift: &mut impl MatTrait ) -> Result<()>
source§fn get_scale_zeropoint(
&self,
scale: &mut f32,
zeropoint: &mut i32
) -> Result<()>
fn get_scale_zeropoint( &self, scale: &mut f32, zeropoint: &mut i32 ) -> Result<()>
fn get_memory_shapes( &self, inputs: &Vector<MatShape>, required_outputs: i32, outputs: &mut Vector<MatShape>, internals: &mut Vector<MatShape> ) -> Result<bool>
fn get_flops( &self, inputs: &Vector<MatShape>, outputs: &Vector<MatShape> ) -> Result<i64>
source§impl TryFrom<Layer> for BlankLayer
impl TryFrom<Layer> for BlankLayer
impl Send for BlankLayer
Auto Trait Implementations§
impl Freeze for BlankLayer
impl RefUnwindSafe for BlankLayer
impl !Sync for BlankLayer
impl Unpin for BlankLayer
impl UnwindSafe for BlankLayer
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
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more