Table of Contents

Method ReadNetFromONNX

Namespace
OpenCvSharp.Dnn
Assembly
OpenCvSharp.dll

ReadNetFromONNX(string, EngineType)

Reads a network model ONNX https://onnx.ai/

public static Net? ReadNetFromONNX(string onnxFile, EngineType engine = EngineType.Auto)

Parameters

onnxFile string

path to the .onnx file with text description of the network architecture.

engine EngineType

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

Returns

Net

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

ReadNetFromONNX(byte[], EngineType)

Reads a network model ONNX https://onnx.ai/ from memory

public static Net? ReadNetFromONNX(byte[] onnxFileData, EngineType engine = EngineType.Auto)

Parameters

onnxFileData byte[]

memory of the first byte of the buffer.

engine EngineType

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

Returns

Net

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

ReadNetFromONNX(ReadOnlySpan<byte>, EngineType)

Reads a network model ONNX https://onnx.ai/ from memory

public static Net? ReadNetFromONNX(ReadOnlySpan<byte> onnxFileData, EngineType engine = EngineType.Auto)

Parameters

onnxFileData ReadOnlySpan<byte>

memory of the first byte of the buffer.

engine EngineType

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

Returns

Net

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