Table of Contents

Method GetMemoryConsumption

Namespace
OpenCvSharp.Dnn
Assembly
OpenCvSharp.dll

GetMemoryConsumption(IEnumerable<MatShape>, IEnumerable<MatType>, out long, out long)

Computes the number of bytes required to store all weights and intermediate blobs for the model (OpenCV 5).

public void GetMemoryConsumption(IEnumerable<MatShape> netInputShapes, IEnumerable<MatType> netInputTypes, out long weights, out long blobs)

Parameters

netInputShapes IEnumerable<MatShape>

shapes for all net inputs.

netInputTypes IEnumerable<MatType>

element types for all net inputs (parallel to netInputShapes).

weights long

output: bytes for weights.

blobs long

output: bytes for intermediate blobs.

GetMemoryConsumption(IEnumerable<MatShape>, IEnumerable<MatType>, out int[], out long[], out long[])

Computes the number of bytes required to store all weights and intermediate blobs for each layer (OpenCV 5).

public void GetMemoryConsumption(IEnumerable<MatShape> netInputShapes, IEnumerable<MatType> netInputTypes, out int[] layerIds, out long[] weights, out long[] blobs)

Parameters

netInputShapes IEnumerable<MatShape>

shapes for all net inputs.

netInputTypes IEnumerable<MatType>

element types for all net inputs (parallel to netInputShapes).

layerIds int[]

output: layer IDs.

weights long[]

output: bytes for weights per layer (order matches layerIds).

blobs long[]

output: bytes for intermediate blobs per layer (order matches layerIds).