[][src]Module opencv::dnn

Deep Neural Network module

This module contains:

  • API for new layers creation, layers are building bricks of neural networks;
  • set of built-in most-useful Layers;
  • API to construct and modify comprehensive neural networks from layers;
  • functionality for loading serialized networks models from different frameworks.

Functionality of this module is designed only for forward pass computations (i.e. network testing). A network training is in principle not supported.

Structs

AbsLayer
BNLLLayer
BackendNode

Derivatives of this class encapsulates functions of certain backends.

BatchNormLayer
BlankLayer

Partial List of Implemented Layers

ChannelsPReLULayer
ConcatLayer
ConstLayer

Constant layer produces the same data blob at an every forward pass.

ConvolutionLayer
CropAndResizeLayer
CropLayer
DeconvolutionLayer
DetectionOutputLayer
DictValue

This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64. @todo Maybe int64 is useless because double type exactly stores at least 2^52 integers.

ELULayer
EltwiseLayer
FlattenLayer
InnerProductLayer
InterpLayer

Bilinear resize layer from https://github.com/cdmh/deeplab-public-ver2

LRNLayer
LayerFactory

%Layer factory allows to create instances of registered layers.

LayerParams

This class provides all data needed to initialize layer.

MVNLayer
MaxUnpoolLayer
Net

This class allows to create and manipulate comprehensive artificial neural networks.

NormalizeBBoxLayer

inline formula

- normalization layer.

PaddingLayer

Adds extra values for specific axes.

PermuteLayer
PoolingLayer
PowerLayer
PriorBoxLayer
ProposalLayer
ReLU6Layer
ReLULayer
RegionLayer
ReorgLayer
ReshapeLayer
ResizeLayer

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

ScaleLayer
ShiftLayer
ShuffleChannelLayer

Permute channels of 4-dimensional input blob.

SigmoidLayer
SliceLayer

Slice layer has several modes:

SoftmaxLayer
SplitLayer
TanHLayer

Enums

Backend

Enum of computation backends supported by layers. @see Net::setPreferableBackend

Target

Enum of target devices for computations. @see Net::setPreferableTarget

Constants

CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_2
CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
CV_DNN_INFERENCE_ENGINE_VPU_TYPE_UNSPECIFIED
DNN_BACKEND_DEFAULT
DNN_BACKEND_HALIDE
DNN_BACKEND_INFERENCE_ENGINE

Intel's Inference Engine computational backend.

DNN_BACKEND_OPENCV
DNN_TARGET_CPU
DNN_TARGET_FPGA

FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin.

DNN_TARGET_MYRIAD
DNN_TARGET_OPENCL
DNN_TARGET_OPENCL_FP16

Traits

ActivationLayer
BackendWrapper

Derivatives of this class wraps cv::Mat for different backends and targets.

BaseConvolutionLayer
Dict

This class implements name-value dictionary, values are instances of DictValue.

LSTMLayer

LSTM recurrent layer

Layer

This interface class allows to build new Layers - are building blocks of networks.

RNNLayer

Classical recurrent layer

Functions

blob_from_image

Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center, subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.

blob_from_image_to

Creates 4-dimensional blob from image. @details This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

blob_from_images

Creates 4-dimensional blob from series of images. Optionally resizes and crops @p images from center, subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.

blob_from_images_to

Creates 4-dimensional blob from series of images. @details This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

clamp
clamp_range
get_available_targets
get_inference_engine_vpu_type

Returns Inference Engine VPU type.

get_plane
images_from_blob

Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std::vectorcv::Mat).

nms_boxes

Performs non maximum suppression given boxes and corresponding scores.

nms_boxes_f64

C++ default parameters

nms_boxes_rotated

C++ default parameters

read_net

Read deep learning network represented in one of the supported formats.

read_net_1

Read deep learning network represented in one of the supported formats. @details This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

read_net_from_caffe

Reads a network model stored in Caffe framework's format.

read_net_from_caffe_buffer

Reads a network model stored in Caffe model in memory.

read_net_from_caffe_str

Reads a network model stored in Caffe model in memory. @details This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

read_net_from_darknet

Reads a network model stored in Darknet model files.

read_net_from_darknet_buffer

Reads a network model stored in Darknet model files.

read_net_from_darknet_str

Reads a network model stored in Darknet model files.

read_net_from_model_optimizer

Load a network from Intel's Model Optimizer intermediate representation.

read_net_from_onnx

Reads a network model ONNX.

read_net_from_onnx_buffer

Reads a network model from ONNX in-memory buffer.

read_net_from_onnx_str

Reads a network model from ONNX in-memory buffer.

read_net_from_tensorflow

Reads a network model stored in TensorFlow framework's format.

read_net_from_tensorflow_buffer

Reads a network model stored in TensorFlow framework's format.

read_net_from_tensorflow_str

Reads a network model stored in TensorFlow framework's format. @details This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

read_net_from_torch

Reads a network model stored in Torch7 framework's format.

read_tensor_from_onnx

Creates blob from .pb file.

read_torch_blob

Loads blob which was serialized as torch.Tensor object of Torch7 framework. @warning This function has the same limitations as readNetFromTorch().

reset_myriad_device

Release a Myriad device (binded by OpenCV).

shape
shape_3d

C++ default parameters

shape_nd
shape_umat
shrink_caffe_model

Convert all weights of Caffe network to half precision floating point.

slice_1d
slice_2d
slice_3d
slice_4d
write_text_graph

Create a text representation for a binary network stored in protocol buffer format.