dnn_Layer
import { dnn_Layer } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.
This interface class allows to build new Layers - are building blocks of networks.
Each class, derived from Layer, must implement forward() method to compute outputs.
Also before using the new layer into networks you must register your layer by using one of dnnLayerFactory "LayerFactory" macros.
Constructors and members
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
blobs
List of learned parameters must be stored here to allow read them by using Net::getParam().
blobs: MatVector;name
Name of the layer instance, can be used for logging or other internal purposes.
set name(value: EmbindString);valuevalue argument (EmbindString).
The string result.
type
Type name which was used for creating layer by layer factory.
set type(value: EmbindString);valuevalue argument (EmbindString).
The string result.
preferableTarget
prefer target for layer forwarding
preferableTarget: number;finalize
Computes and sets internal parameters according to inputs, outputs and blobs.
finalize(inputs: MatVector, outputs: MatVector): void;inputsvector of already allocated input blobs
outputsOutput destination, filled by the native operation. vector of already allocated output blobs
This method is called after network has allocated all memory for input and output blobs and before inferencing.
run
Allocates layer and computes output. deprecated: This method will be removed in the future release.
run(inputs: MatVector, outputs: MatVector, internals: MatVector): void;inputsinputs argument (MatVector).
outputsOutput destination, filled by the native operation. outputs argument (MatVector).
internalsInput/output value, modified by the native operation. internals argument (MatVector).
outputNameToIndex
FIXIT const Returns index of output blob in output array. See: inputNameToIndex()
outputNameToIndex(outputName: EmbindString): number;outputNameoutput name argument (EmbindString).
The number result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.