This interface class allows to build new Layers - are building blocks of networks.
More...
#include "dnn.hpp"
This interface class allows to build new Layers - are building blocks of networks.
Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs. Also before using the new layer into networks you must register your layer by using one of LayerFactory macros.
cv::dnn::Layer::Layer |
( |
| ) |
|
virtual cv::dnn::Layer::~Layer |
( |
| ) |
|
|
virtual |
virtual void cv::dnn::Layer::allocate |
( |
const std::vector< Blob * > & |
input, |
|
|
std::vector< Blob > & |
output |
|
) |
| |
|
pure virtual |
Allocates internal buffers and output blobs with respect to the shape of inputs.
- Parameters
-
[in] | input | vector of already allocated input blobs |
[out] | output | vector of output blobs, which must be allocated |
This method must create each produced blob according to shape of input
blobs and internal layer params. If this method is called first time then output
vector consists from empty blobs and its size determined by number of output connections. This method can be called multiple times if size of any input
blob was changed.
virtual void cv::dnn::Layer::forward |
( |
std::vector< Blob * > & |
input, |
|
|
std::vector< Blob > & |
output |
|
) |
| |
|
pure virtual |
Given the input
blobs, computes the output blobs
.
- Parameters
-
[in] | input | the input blobs. |
[out] | output | allocated output blobs, which will store results of the computation. |
virtual int cv::dnn::Layer::inputNameToIndex |
( |
String |
inputName | ) |
|
|
virtual |
Returns index of input blob into the input array.
- Parameters
-
inputName | label of input blob |
Each layer input and output can be labeled to easily identify them using "%<layer_name%>[.output_name]" notation. This method maps label of input blob to its index into input vector.
virtual int cv::dnn::Layer::outputNameToIndex |
( |
String |
outputName | ) |
|
|
virtual |
std::vector<Blob> cv::dnn::Layer::blobs |
List of learned parameters must be stored here to allow read them by using Net::getParam().
Name of the layer instance, can be used for logging or other internal purposes.
Type name which was used for creating layer by layer factory.
The documentation for this struct was generated from the following file:
- /build/master-contrib_docs-mac/opencv_contrib/modules/dnn/include/opencv2/dnn/dnn.hpp