dnn_readNet
import { dnn_readNet } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Read deep learning network represented in one of the supported formats.
dnn_readNet(model: EmbindString, config: EmbindString, framework: EmbindString, engine: number): dnn_Net;4 available overloads
dnn_readNet(model: EmbindString): dnn_Net;dnn_readNet(model: EmbindString, config: EmbindString): dnn_Net;dnn_readNet(model: EmbindString, config: EmbindString, framework: EmbindString): dnn_Net;dnn_readNet(model: EmbindString, config: EmbindString, framework: EmbindString, engine: number): dnn_Net;modelBinary file contains trained weights. The following file extensions are expected for models from different frameworks:
*.pb(TensorFlow, https://www.tensorflow.org/)*.bin|*.onnx(OpenVINO, https://software.intel.com/openvino-toolkit)*.onnx(ONNX, https://onnx.ai/)configText file contains network configuration. It could be a file with the following extensions:
*.pbtxt(TensorFlow, https://www.tensorflow.org/)*.xml(OpenVINO, https://software.intel.com/openvino-toolkit)frameworkExplicit framework name tag to determine a format.
engineselect 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. Use ENGINE_CLASSIC if you want to use other back-ends.
Net object.
This function automatically detects an origin framework of trained model
and calls an appropriate function such readNetFromTensorflow, readNetFromONNX.
An order of model and config arguments does not matter.
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.