Package org.opencv.dnn
Class Layer
java.lang.Object
org.opencv.core.Algorithm
org.opencv.dnn.Layer
public class Layer extends Algorithm
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 REF: dnnLayerFactory "LayerFactory" macros.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
Layer(long addr)
-
Method Summary
Modifier and Type Method Description static Layer
__fromPtr__(long addr)
protected void
finalize()
void
finalize(List<Mat> inputs, List<Mat> outputs)
Computes and sets internal parameters according to inputs, outputs and blobs.List<Mat>
get_blobs()
String
get_name()
int
get_preferableTarget()
String
get_type()
int
outputNameToIndex(String outputName)
Returns index of output blob in output array.void
run(List<Mat> inputs, List<Mat> outputs, List<Mat> internals)
Deprecated.This method will be removed in the future release.void
set_blobs(List<Mat> blobs)
Methods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
Constructor Details
-
Method Details
-
__fromPtr__
-
finalize
Computes and sets internal parameters according to inputs, outputs and blobs.- Parameters:
outputs
- vector of already allocated output blobs If this method is called after network has allocated all memory for input and output blobs and before inferencing.inputs
- automatically generated
-
run
Deprecated.This method will be removed in the future release.Allocates layer and computes output.- Parameters:
inputs
- automatically generatedoutputs
- automatically generatedinternals
- automatically generated
-
outputNameToIndex
Returns index of output blob in output array. SEE: inputNameToIndex()- Parameters:
outputName
- automatically generated- Returns:
- automatically generated
-
get_blobs
-
set_blobs
-
get_name
-
get_type
-
get_preferableTarget
-
finalize
-