![]() |
OpenCV 5.0.0
Open Source Computer Vision
|
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 Utilities for New Layers Registration), 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 readNetFromTensorflow()).
Built-in layers reproduce the functionality of the corresponding ONNX and TensorFlow operators. The following layers are among the core building blocks used to assemble imported networks:
Typedefs | |
| typedef void(* | cv::dnn::ActivationFunc) (const void *input, void *output, size_t len, const float *params) |
Enumerations | |
| enum | cv::dnn::ActivationType { cv::dnn::ACTIV_NONE = 0 , cv::dnn::ACTIV_MISH , cv::dnn::ACTIV_SWISH , cv::dnn::ACTIV_SIGMOID , cv::dnn::ACTIV_TANH , cv::dnn::ACTIV_ELU , cv::dnn::ACTIV_HARDSWISH , cv::dnn::ACTIV_HARDSIGMOID , cv::dnn::ACTIV_GELU , cv::dnn::ACTIV_GELU_APPROX , cv::dnn::ACTIV_RELU , cv::dnn::ACTIV_CLIP } |
| enum | cv::dnn::AutoPadding { cv::dnn::AUTO_PAD_NONE = 0 , cv::dnn::AUTO_PAD_SAME_UPPER = 1 , cv::dnn::AUTO_PAD_SAME_LOWER = 2 , cv::dnn::AUTO_PAD_VALID = 3 } |
| enum | cv::dnn::LossReduction { cv::dnn::LOSS_REDUCTION_NONE = 0 , cv::dnn::LOSS_REDUCTION_MEAN = 1 , cv::dnn::LOSS_REDUCTION_SUM = 2 } |
Functions | |
| ActivationFunc | cv::dnn::getActivationFunc (int activationType) |
| typedef void(* cv::dnn::ActivationFunc) (const void *input, void *output, size_t len, const float *params) |
#include <opencv2/dnn/all_layers.hpp>
#include <opencv2/dnn/all_layers.hpp>
Activation type enumeration for dispatched activation function retrieval.
| enum cv::dnn::AutoPadding |
#include <opencv2/dnn/all_layers.hpp>
#include <opencv2/dnn/all_layers.hpp>
| Enumerator | |
|---|---|
| LOSS_REDUCTION_NONE Python: cv.dnn.LOSS_REDUCTION_NONE | |
| LOSS_REDUCTION_MEAN Python: cv.dnn.LOSS_REDUCTION_MEAN | |
| LOSS_REDUCTION_SUM Python: cv.dnn.LOSS_REDUCTION_SUM | |
| ActivationFunc cv::dnn::getActivationFunc | ( | int | activationType | ) |
#include <opencv2/dnn/all_layers.hpp>
Returns a platform-optimized activation function pointer for the given type. The returned function is selected via CPU dispatch for the best available ISA.