Skip to content

dnn_Backend

Deep neural networksclassOpenCV 5.0.0
import { dnn_Backend } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSdnn_Backend
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

Enum of computation backends supported by layers. See: Net::setPreferableBackend

Constructors and members

static DNN_BACKEND_DEFAULT

DNN_BACKEND_DEFAULT equals to OPENCV_DNN_BACKEND_DEFAULT, which can be defined using CMake or a configuration parameter

DNN_BACKEND_DEFAULT: dnn_BackendValue<0>,

static DNN_BACKEND_INFERENCE_ENGINE

internal - use DNN_BACKEND_INFERENCE_ENGINE + setInferenceEngineBackendType()

DNN_BACKEND_INFERENCE_ENGINE: dnn_BackendValue<2>,

static DNN_BACKEND_OPENCV

Intel OpenVINO computational backend, supported targets: CPU, OPENCL, OPENCL_FP16, MYRIAD, HDDL, NPU

Note: Tutorial how to build OpenCV with OpenVINO: tutorial_dnn_openvino

DNN_BACKEND_OPENCV: dnn_BackendValue<3>,

static DNN_BACKEND_VKCOM

dnn backend vkcom constant (2+2), defined by OpenCV for cv::dnn.

DNN_BACKEND_VKCOM: dnn_BackendValue<4>,

static DNN_BACKEND_CUDA

dnn backend cuda constant (2+3), defined by OpenCV for cv::dnn.

DNN_BACKEND_CUDA: dnn_BackendValue<5>,

static DNN_BACKEND_WEBNN

dnn backend webnn constant (2+4), defined by OpenCV for cv::dnn.

DNN_BACKEND_WEBNN: dnn_BackendValue<6>,

static DNN_BACKEND_TIMVX

dnn backend timvx constant (2+5), defined by OpenCV for cv::dnn.

DNN_BACKEND_TIMVX: dnn_BackendValue<7>,

static DNN_BACKEND_CANN

dnn backend cann constant (2+6), defined by OpenCV for cv::dnn.

DNN_BACKEND_CANN: dnn_BackendValue<8>

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.