Table of Contents

Method ReadNetFromTensorflow

Namespace
OpenCvSharp.Dnn
Assembly
OpenCvSharp.dll

ReadNetFromTensorflow(string, string?, EngineType)

Reads a network model stored in Tensorflow model file.

public static Net? ReadNetFromTensorflow(string model, string? config = null, EngineType engine = EngineType.Auto)

Parameters

model string

path to the .pb file with binary protobuf description of the network architecture

config string

path to the .pbtxt file that contains text graph definition in protobuf format.

engine EngineType

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

Returns

Net

Resulting Net object is built by text graph using weights from a binary one that let us make it more flexible.

Remarks

This is shortcut consisting from createTensorflowImporter and Net::populateNet calls.

ReadNetFromTensorflow(byte[], byte[]?, EngineType)

Reads a network model stored in Tensorflow model from memory.

public static Net? ReadNetFromTensorflow(byte[] bufferModel, byte[]? bufferConfig = null, EngineType engine = EngineType.Auto)

Parameters

bufferModel byte[]

buffer containing the content of the pb file

bufferConfig byte[]

buffer containing the content of the pbtxt file (optional)

engine EngineType

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

Returns

Net

Remarks

This is shortcut consisting from createTensorflowImporter and Net::populateNet calls.

ReadNetFromTensorflow(ReadOnlySpan<byte>, ReadOnlySpan<byte>, EngineType)

Reads a network model stored in Tensorflow model from memory.

public static Net? ReadNetFromTensorflow(ReadOnlySpan<byte> bufferModel, ReadOnlySpan<byte> bufferConfig = default, EngineType engine = EngineType.Auto)

Parameters

bufferModel ReadOnlySpan<byte>

buffer containing the content of the pb file

bufferConfig ReadOnlySpan<byte>

buffer containing the content of the pbtxt file (optional)

engine EngineType

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

Returns

Net

Remarks

This is shortcut consisting from createTensorflowImporter and Net::populateNet calls.