Table of Contents

Method ReadNet

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

ReadNet(string, string, string, EngineType)

Read deep learning network represented in one of the supported formats.

This function automatically detects an origin framework of trained model and calls an appropriate function such @ref readNetFromTensorflow, @ref readNetFromONNX, or @ref readNetFromModelOptimizer. The Caffe, Darknet and Torch parsers were removed in OpenCV 5.

public static Net ReadNet(string model, string config = "", string framework = "", EngineType engine = EngineType.Auto)

Parameters

model string

Binary file contains trained weights. The following file * extensions are expected for models from different frameworks: * * *.pb (TensorFlow, https://www.tensorflow.org/) * * *.onnx (ONNX, https://onnx.ai/) * * *.bin (OpenVINO, https://software.intel.com/openvino-toolkit)

config string

Text 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)

framework string

Explicit framework name tag to determine a format.

engine EngineType

DNN engine to use. Auto tries the new engine first and falls back to the classic one.

Returns

Net