Partial List of Implemented Layers#

Detailed Description#

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:

  • 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 -))

Classes#

Name

Description

class cv::dnn::AbsLayer

View details

class cv::dnn::AccumLayer

View details

class cv::dnn::AcoshLayer

View details

class cv::dnn::AcosLayer

View details

struct cv::dnn::ActivationInt8Params

View details

class cv::dnn::ActivationLayer

View details

class cv::dnn::ActivationLayerInt8

View details

class cv::dnn::AffineGridLayer

View details

class cv::dnn::ArgLayer

ArgMax/ArgMin layer. View details

class cv::dnn::AsinhLayer

View details

class cv::dnn::AsinLayer

View details

class cv::dnn::AtanhLayer

View details

class cv::dnn::AtanLayer

View details

class cv::dnn::AttentionLayer

View details

class cv::dnn::AttentionOnnxAiLayer

View details

class cv::dnn::AveragePoolLayer

View details

class cv::dnn::BaseConvolutionLayer

View details

class cv::dnn::BatchNorm2Layer

View details

class cv::dnn::BatchNormLayer

View details

class cv::dnn::BatchNormLayerInt8

View details

class cv::dnn::BitShiftLayer

View details

class cv::dnn::BlackmanWindowLayer

View details

class cv::dnn::BlankLayer

View details

class cv::dnn::BNLLLayer

View details

class cv::dnn::Cast2Layer

View details

class cv::dnn::CastLayer

View details

class cv::dnn::CeilLayer

View details

class cv::dnn::CeluLayer

View details

class cv::dnn::CenterCropPadLayer

View details

class cv::dnn::ChannelsPReLULayer

View details

class cv::dnn::ClipLayer

View details

class cv::dnn::CompareLayer

View details

class cv::dnn::Concat2Layer

View details

class cv::dnn::ConcatLayer

View details

class cv::dnn::ConstantOfShapeLayer

View details

class cv::dnn::ConstLayer

View details

class cv::dnn::Conv2Int8Layer

View details

struct cv::dnn::Conv2Int8Params

View details

class cv::dnn::Conv2Layer

View details

class cv::dnn::ConvolutionLayer

View details

class cv::dnn::ConvolutionLayerInt8

View details

class cv::dnn::ConvTranspose2Layer

View details

class cv::dnn::CorrelationLayer

View details

class cv::dnn::CoshLayer

View details

class cv::dnn::CosLayer

View details

class cv::dnn::CropAndResizeLayer

View details

class cv::dnn::CropLayer

View details

class cv::dnn::CumSumLayer

View details

class cv::dnn::DataAugmentationLayer

View details

class cv::dnn::DeconvolutionLayer

View details

class cv::dnn::DepthToSpaceLayer

View details

class cv::dnn::DequantizeLayer

View details

class cv::dnn::DequantizeLinearLayer

View details

class cv::dnn::DetectionOutputLayer

Detection output layer. View details

class cv::dnn::DetLayer

View details

class cv::dnn::DFTLayer

View details

class cv::dnn::EinsumLayer

This function performs array summation based on the Einstein summation convention. The function allows for concise expressions of various mathematical operations using subscripts. View details

class cv::dnn::Eltwise2Int8Layer

View details

struct cv::dnn::Eltwise2Int8Params

View details

class cv::dnn::EltwiseLayer

Element wise operation on inputs. View details

class cv::dnn::EltwiseLayerInt8

View details

class cv::dnn::ELULayer

View details

class cv::dnn::ErfLayer

View details

class cv::dnn::Expand2Layer

View details

class cv::dnn::ExpandLayer

View details

class cv::dnn::ExpLayer

View details

class cv::dnn::EyeLikeLayer

View details

class cv::dnn::FlattenLayer

View details

class cv::dnn::FloorLayer

View details

class cv::dnn::FlowWarpLayer

View details

class cv::dnn::Gather2Layer

View details

class cv::dnn::GatherElementsLayer

GatherElements layer GatherElements takes two inputs data and indices of the same rank r >= 1 and an optional attribute axis and works such that: output[i][j][k] = data[index[i][j][k]][j][k] if axis = 0 and r = 3 output[i][j][k] = data[i][index[i][j][k]][k] if axis = 1 and r = 3 output[i][j][k] = data[i][j][index[i][j][k]] if axis = 2 and r = 3. View details

class cv::dnn::GatherLayer

Gather layer. View details

class cv::dnn::GatherNDLayer

GatherND layer. View details

class cv::dnn::GeluApproximationLayer

View details

class cv::dnn::GeluLayer

View details

class cv::dnn::GemmLayer

View details

class cv::dnn::GlobalAveragePoolLayer

View details

class cv::dnn::GridSampleLayer

View details

class cv::dnn::GroupNormLayer

View details

class cv::dnn::GRULayer

GRU recurrent one-layer. View details

class cv::dnn::HammingWindowLayer

View details

class cv::dnn::HannWindowLayer

View details

class cv::dnn::HardmaxLayer

View details

class cv::dnn::HardSigmoidLayer

View details

class cv::dnn::HardSwishLayer

View details

class cv::dnn::IfLayer

View details

struct cv::dnn::InnerProductInt8Params

View details

class cv::dnn::InnerProductLayer

View details

class cv::dnn::InnerProductLayerInt8

View details

class cv::dnn::InstanceNormLayer

View details

class cv::dnn::InterpLayer

Bilinear resize layer from cdmh/deeplab-public-ver2. View details

class cv::dnn::IsInfLayer

View details

class cv::dnn::IsNaNLayer

View details

class cv::dnn::LayerNorm2Layer

View details

class cv::dnn::LayerNormLayer

View details

class cv::dnn::LogLayer

View details

class cv::dnn::LoopLayer

View details

class cv::dnn::LRNLayer

View details

class cv::dnn::LSTM2Layer

View details

class cv::dnn::LSTMLayer

LSTM recurrent layer. View details

class cv::dnn::MatMulInt8Layer

View details

struct cv::dnn::MatMulInt8Params

View details

class cv::dnn::MatMulLayer

View details

class cv::dnn::MaxPoolLayer

View details

class cv::dnn::MaxUnpoolLayer

View details

class cv::dnn::MishLayer

View details

class cv::dnn::MVNLayer

View details

class cv::dnn::NaryEltwiseLayer

View details

class cv::dnn::NegativeLogLikelihoodLossLayer

View details

class cv::dnn::NonMaxSuppressionLayer

View details

class cv::dnn::NonZeroLayer

View details

class cv::dnn::NormalizeBBoxLayer

\( L_p \) - normalization layer. View details

class cv::dnn::NotLayer

View details

class cv::dnn::OneHotLayer

View details

class cv::dnn::Pad2Layer

View details

class cv::dnn::PaddingLayer

Adds extra values for specific axes. View details

class cv::dnn::PermuteLayer

View details

class cv::dnn::Pool2Int8Layer

View details

struct cv::dnn::Pool2Int8Params

View details

class cv::dnn::PoolingLayer

View details

class cv::dnn::PoolingLayerInt8

View details

class cv::dnn::PowerLayer

View details

class cv::dnn::PriorBoxLayer

View details

class cv::dnn::ProposalLayer

View details

class cv::dnn::QuantizeLayer

View details

class cv::dnn::QuantizeLinearLayer

View details

class cv::dnn::RandomNormalLikeLayer

View details

class cv::dnn::RangeLayer

View details

class cv::dnn::ReciprocalLayer

View details

class cv::dnn::Reduce2Layer

View details

class cv::dnn::ReduceLayer

View details

class cv::dnn::RegionLayer

View details

class cv::dnn::ReLU6Layer

View details

class cv::dnn::ReLULayer

View details

class cv::dnn::ReorgLayer

View details

class cv::dnn::RequantizeLayer

View details

class cv::dnn::Reshape2Layer

View details

class cv::dnn::ReshapeLayer

View details

class cv::dnn::Resize2Layer

View details

class cv::dnn::ResizeLayer

Resize input 4-dimensional blob by nearest neighbor or bilinear strategy. View details

class cv::dnn::RMSNormLayer

View details

class cv::dnn::RNNLayer

Classical recurrent layer. View details

class cv::dnn::RoiAlignLayer

View details

class cv::dnn::RotaryEmbeddingLayer

View details

class cv::dnn::RoundLayer

View details

class cv::dnn::ScaleLayer

View details

class cv::dnn::ScaleLayerInt8

View details

class cv::dnn::ScatterLayer

View details

class cv::dnn::ScatterNDLayer

View details

class cv::dnn::SDPALayer

View details

class cv::dnn::SeluLayer

View details

class cv::dnn::ShapeLayer

View details

class cv::dnn::ShiftLayer

View details

class cv::dnn::ShiftLayerInt8

View details

class cv::dnn::ShrinkLayer

View details

class cv::dnn::ShuffleChannelLayer

View details

class cv::dnn::SigmoidLayer

View details

class cv::dnn::SignLayer

View details

class cv::dnn::SinhLayer

View details

class cv::dnn::SinLayer

View details

class cv::dnn::SizeLayer

View details

class cv::dnn::Slice2Layer

View details

class cv::dnn::SliceLayer

View details

class cv::dnn::SoftmaxCrossEntropyLossLayer

View details

class cv::dnn::SoftmaxLayer

View details

class cv::dnn::SoftmaxLayerInt8

View details

class cv::dnn::SoftplusLayer

View details

class cv::dnn::SoftsignLayer

View details

class cv::dnn::SpaceToDepthLayer

View details

class cv::dnn::Split2Layer

View details

class cv::dnn::SplitLayer

View details

class cv::dnn::SqrtLayer

View details

class cv::dnn::SqueezeLayer

View details

class cv::dnn::SwishLayer

View details

class cv::dnn::TanHLayer

View details

class cv::dnn::TanLayer

View details

class cv::dnn::ThresholdedReluLayer

View details

class cv::dnn::Tile2Layer

View details

class cv::dnn::TileLayer

View details

class cv::dnn::TopK2Layer

View details

class cv::dnn::TopKLayer

View details

class cv::dnn::TransformLayoutLayer

View details

class cv::dnn::TransposeLayer

View details

class cv::dnn::TriluLayer

View details

class cv::dnn::UniqueLayer

View details

class cv::dnn::UnsqueezeLayer

View details

Enumerations#

View details

View details

View details

Typedef Documentation#

ActivationFunc#

typedef void(* cv::dnn::ActivationFunc)(const void *input, void *output, size_t len, const float *params)

#include <opencv2/dnn/all_layers.hpp>

Enumeration Type Documentation#

ActivationType#

enum cv::dnn::ActivationType

#include <opencv2/dnn/all_layers.hpp>

Activation type enumeration for dispatched activation function retrieval.

Enumerator:

ACTIV_NONE
Python: cv.dnn.ACTIV_NONE

ACTIV_MISH
Python: cv.dnn.ACTIV_MISH

ACTIV_SWISH
Python: cv.dnn.ACTIV_SWISH

ACTIV_SIGMOID
Python: cv.dnn.ACTIV_SIGMOID

ACTIV_TANH
Python: cv.dnn.ACTIV_TANH

ACTIV_ELU
Python: cv.dnn.ACTIV_ELU

ACTIV_HARDSWISH
Python: cv.dnn.ACTIV_HARDSWISH

ACTIV_HARDSIGMOID
Python: cv.dnn.ACTIV_HARDSIGMOID

ACTIV_GELU
Python: cv.dnn.ACTIV_GELU

ACTIV_GELU_APPROX
Python: cv.dnn.ACTIV_GELU_APPROX

ACTIV_RELU
Python: cv.dnn.ACTIV_RELU

ACTIV_CLIP
Python: cv.dnn.ACTIV_CLIP

AutoPadding#

enum cv::dnn::AutoPadding

#include <opencv2/dnn/all_layers.hpp>

Enumerator:

AUTO_PAD_NONE
Python: cv.dnn.AUTO_PAD_NONE

AUTO_PAD_SAME_UPPER
Python: cv.dnn.AUTO_PAD_SAME_UPPER

AUTO_PAD_SAME_LOWER
Python: cv.dnn.AUTO_PAD_SAME_LOWER

AUTO_PAD_VALID
Python: cv.dnn.AUTO_PAD_VALID

LossReduction#

enum cv::dnn::LossReduction

#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

Function Documentation#

getActivationFunc()#

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.