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
netInputShapesIEnumerable<MatShape>shapes for all net inputs.
netInputTypesIEnumerable<MatType>element types for all net inputs (parallel to
netInputShapes).weightslongoutput: bytes for weights.
blobslongoutput: 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
netInputShapesIEnumerable<MatShape>shapes for all net inputs.
netInputTypesIEnumerable<MatType>element types for all net inputs (parallel to
netInputShapes).layerIdsint[]output: layer IDs.
weightslong[]output: bytes for weights per layer (order matches
layerIds).blobslong[]output: bytes for intermediate blobs per layer (order matches
layerIds).