Skip to content

dnn_readNetFromONNX1

Deep neural networksfunctionOpenCV 5.0.0
import { dnn_readNetFromONNX1 } from '@banou/opencv-wasm'

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

ARGUMENTSbuffer, engine
FUNCTIONdnn_readNetFromONNX1
RETURN TYPEdnn_Net
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Reads a network model from <a href="https://onnx.ai/">ONNX</a> in-memory buffer.

dnn_readNetFromONNX1(buffer: ucharVector, engine: number): dnn_Net;
2 available overloads
dnn_readNetFromONNX1(buffer: ucharVector): dnn_Net;
dnn_readNetFromONNX1(buffer: ucharVector, engine: number): dnn_Net;
buffer

in-memory buffer that stores the ONNX model bytes.

engine

select DNN engine to be used. With auto selection the new engine is used first and falls back to classic. Please pay attention that the new DNN does not support non-CPU back-ends for now.

Returns

Network object that ready to do forward, throw an exception in failure cases.

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.