@Namespace(value="cv::dnn") @NoOffset @Properties(inherit=opencv_dnn.class) public class Net extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Net()
Default constructor.
|
Net(long size)
Native array allocator.
|
Net(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addLayer(BytePointer name,
BytePointer type,
LayerParams params)
\brief Adds new layer to the net.
|
int |
addLayer(String name,
String type,
LayerParams params) |
int |
addLayerToPrev(BytePointer name,
BytePointer type,
LayerParams params)
\brief Adds new layer and connects its first input to the first output of previously added layer.
|
int |
addLayerToPrev(String name,
String type,
LayerParams params) |
void |
connect(BytePointer outPin,
BytePointer inpPin)
\brief Connects output of the first layer to input of the second layer.
|
void |
connect(int outLayerId,
int outNum,
int inpLayerId,
int inpNum)
\brief Connects #\p outNum output of the first layer to #\p inNum input of the second layer.
|
void |
connect(String outPin,
String inpPin) |
BytePointer |
dump()
\brief Dump net to String
|
void |
dumpToFile(BytePointer path)
\brief Dump net structure, hyperparameters, backend, target and fusion to dot file
|
void |
dumpToFile(String path) |
boolean |
empty()
Returns true if there are no layers in the network.
|
void |
enableFusion(boolean fusion)
\brief Enables or disables layer fusion in the network.
|
Mat |
forward() |
Mat |
forward(BytePointer outputName)
\brief Runs forward pass to compute output of layer with name \p outputName.
|
void |
forward(GpuMatVector outputBlobs) |
void |
forward(GpuMatVector outputBlobs,
BytePointer outputName) |
void |
forward(GpuMatVector outputBlobs,
String outputName) |
void |
forward(GpuMatVector outputBlobs,
StringVector outBlobNames) |
void |
forward(MatVector outputBlobs) |
void |
forward(MatVector outputBlobs,
BytePointer outputName)
\brief Runs forward pass to compute output of layer with name \p outputName.
|
void |
forward(MatVector outputBlobs,
String outputName) |
void |
forward(MatVector outputBlobs,
StringVector outBlobNames)
\brief Runs forward pass to compute outputs of layers listed in \p outBlobNames.
|
Mat |
forward(String outputName) |
void |
forward(UMatVector outputBlobs) |
void |
forward(UMatVector outputBlobs,
BytePointer outputName) |
void |
forward(UMatVector outputBlobs,
String outputName) |
void |
forward(UMatVector outputBlobs,
StringVector outBlobNames) |
void |
forwardAndRetrieve(MatVectorVector outputBlobs,
StringVector outBlobNames)
\brief Runs forward pass to compute outputs of layers listed in \p outBlobNames.
|
AsyncArray |
forwardAsync() |
AsyncArray |
forwardAsync(BytePointer outputName)
\brief Runs forward pass to compute output of layer with name \p outputName.
|
AsyncArray |
forwardAsync(String outputName) |
long |
getFLOPS(int layerId,
IntPointer netInputShape)
\overload
|
long |
getFLOPS(int layerId,
MatShapeVector netInputShapes)
\overload
|
long |
getFLOPS(IntPointer netInputShape)
\overload
|
long |
getFLOPS(MatShapeVector netInputShapes)
\brief Computes FLOP for whole loaded model with specified input shapes.
|
Layer |
getLayer(DictValue layerId)
\brief Returns pointer to layer with specified id or name which the network use.
|
int |
getLayerId(BytePointer layer)
\brief Converts string name of the layer to the integer identifier.
|
int |
getLayerId(String layer) |
StringVector |
getLayerNames() |
int |
getLayersCount(BytePointer layerType)
\brief Returns count of layers of specified type.
|
int |
getLayersCount(String layerType) |
void |
getLayerShapes(IntPointer netInputShape,
int layerId,
MatShapeVector inLayerShapes,
MatShapeVector outLayerShapes)
\brief Returns input and output shapes for layer with specified
id in loaded model; preliminary inferencing isn't necessary.
|
void |
getLayerShapes(MatShapeVector netInputShapes,
int layerId,
MatShapeVector inLayerShapes,
MatShapeVector outLayerShapes)
\overload
|
void |
getLayersShapes(IntPointer netInputShape,
int[] layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes) |
void |
getLayersShapes(IntPointer netInputShape,
IntBuffer layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes) |
void |
getLayersShapes(IntPointer netInputShape,
IntPointer layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes)
\overload
|
void |
getLayersShapes(MatShapeVector netInputShapes,
int[] layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes) |
void |
getLayersShapes(MatShapeVector netInputShapes,
IntBuffer layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes) |
void |
getLayersShapes(MatShapeVector netInputShapes,
IntPointer layersIds,
MatShapeVectorVector inLayersShapes,
MatShapeVectorVector outLayersShapes)
\brief Returns input and output shapes for all layers in loaded model;
preliminary inferencing isn't necessary.
|
void |
getLayerTypes(StringVector layersTypes)
\brief Returns list of types for layer used in model.
|
void |
getMemoryConsumption(int layerId,
IntPointer netInputShape,
SizeTPointer weights,
SizeTPointer blobs)
\overload
|
void |
getMemoryConsumption(int layerId,
MatShapeVector netInputShapes,
SizeTPointer weights,
SizeTPointer blobs)
\overload
|
void |
getMemoryConsumption(IntPointer netInputShape,
int[] layerIds,
SizeTPointer weights,
SizeTPointer blobs) |
void |
getMemoryConsumption(IntPointer netInputShape,
IntBuffer layerIds,
SizeTPointer weights,
SizeTPointer blobs) |
void |
getMemoryConsumption(IntPointer netInputShape,
IntPointer layerIds,
SizeTPointer weights,
SizeTPointer blobs)
\overload
|
void |
getMemoryConsumption(IntPointer netInputShape,
SizeTPointer weights,
SizeTPointer blobs)
\overload
|
void |
getMemoryConsumption(MatShapeVector netInputShapes,
int[] layerIds,
SizeTPointer weights,
SizeTPointer blobs) |
void |
getMemoryConsumption(MatShapeVector netInputShapes,
IntBuffer layerIds,
SizeTPointer weights,
SizeTPointer blobs) |
void |
getMemoryConsumption(MatShapeVector netInputShapes,
IntPointer layerIds,
SizeTPointer weights,
SizeTPointer blobs)
\brief Computes bytes number which are required to store
all weights and intermediate blobs for each layer.
|
void |
getMemoryConsumption(MatShapeVector netInputShapes,
SizeTPointer weights,
SizeTPointer blobs)
\brief Computes bytes number which are required to store
all weights and intermediate blobs for model.
|
Mat |
getParam(DictValue layer) |
Mat |
getParam(DictValue layer,
int numParam)
\brief Returns parameter blob of the layer.
|
long |
getPerfProfile(double[] timings) |
long |
getPerfProfile(DoubleBuffer timings) |
long |
getPerfProfile(DoublePointer timings)
\brief Returns overall time for inference and timings (in ticks) for layers.
|
IntPointer |
getUnconnectedOutLayers()
\brief Returns indexes of layers with unconnected outputs.
|
StringVector |
getUnconnectedOutLayersNames()
\brief Returns names of layers with unconnected outputs.
|
Net |
position(long position) |
static Net |
readFromModelOptimizer(byte[] bufferModelConfig,
byte[] bufferWeights) |
static Net |
readFromModelOptimizer(byte[] bufferModelConfigPtr,
long bufferModelConfigSize,
byte[] bufferWeightsPtr,
long bufferWeightsSize) |
static Net |
readFromModelOptimizer(ByteBuffer bufferModelConfig,
ByteBuffer bufferWeights)
\brief Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR).
|
static Net |
readFromModelOptimizer(ByteBuffer bufferModelConfigPtr,
long bufferModelConfigSize,
ByteBuffer bufferWeightsPtr,
long bufferWeightsSize) |
static Net |
readFromModelOptimizer(BytePointer xml,
BytePointer bin)
\brief Create a network from Intel's Model Optimizer intermediate representation (IR).
|
static Net |
readFromModelOptimizer(BytePointer bufferModelConfigPtr,
long bufferModelConfigSize,
BytePointer bufferWeightsPtr,
long bufferWeightsSize)
\brief Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR).
|
static Net |
readFromModelOptimizer(String xml,
String bin) |
void |
setHalideScheduler(BytePointer scheduler)
\brief Compile Halide layers.
|
void |
setHalideScheduler(String scheduler) |
void |
setInput(GpuMat blob) |
void |
setInput(GpuMat blob,
BytePointer name,
double scalefactor,
Scalar mean) |
void |
setInput(GpuMat blob,
String name,
double scalefactor,
Scalar mean) |
void |
setInput(Mat blob) |
void |
setInput(Mat blob,
BytePointer name,
double scalefactor,
Scalar mean)
\brief Sets the new input value for the network
|
void |
setInput(Mat blob,
String name,
double scalefactor,
Scalar mean) |
void |
setInput(UMat blob) |
void |
setInput(UMat blob,
BytePointer name,
double scalefactor,
Scalar mean) |
void |
setInput(UMat blob,
String name,
double scalefactor,
Scalar mean) |
void |
setInputShape(BytePointer inputName,
IntPointer shape)
\brief Specify shape of network input.
|
void |
setInputShape(String inputName,
IntPointer shape) |
void |
setInputsNames(StringVector inputBlobNames)
\brief Sets outputs names of the network input pseudo layer.
|
void |
setParam(DictValue layer,
int numParam,
Mat blob)
\brief Sets the new value for the learned param of the layer.
|
void |
setPreferableBackend(int backendId)
\brief Ask network to use specific computation backend where it supported.
|
void |
setPreferableTarget(int targetId)
\brief Ask network to make computations on specific target device.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public Net(Pointer p)
Pointer.Pointer(Pointer)
.public Net(long size)
Pointer.position(long)
.public Net()
@ByVal public static Net readFromModelOptimizer(@opencv_core.Str BytePointer xml, @opencv_core.Str BytePointer bin)
xml
- [in] XML configuration file with network's topology.bin
- [in] Binary file with trained weights.
Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine
backend.@ByVal public static Net readFromModelOptimizer(@opencv_core.Str String xml, @opencv_core.Str String bin)
@ByVal public static Net readFromModelOptimizer(@Cast(value="uchar*") @StdVector ByteBuffer bufferModelConfig, @Cast(value="uchar*") @StdVector ByteBuffer bufferWeights)
bufferModelConfig
- [in] buffer with model's configuration.bufferWeights
- [in] buffer with model's trained weights.@ByVal public static Net readFromModelOptimizer(@Cast(value="uchar*") @StdVector byte[] bufferModelConfig, @Cast(value="uchar*") @StdVector byte[] bufferWeights)
@ByVal public static Net readFromModelOptimizer(@Cast(value="const uchar*") BytePointer bufferModelConfigPtr, @Cast(value="size_t") long bufferModelConfigSize, @Cast(value="const uchar*") BytePointer bufferWeightsPtr, @Cast(value="size_t") long bufferWeightsSize)
bufferModelConfigPtr
- [in] buffer pointer of model's configuration.bufferModelConfigSize
- [in] buffer size of model's configuration.bufferWeightsPtr
- [in] buffer pointer of model's trained weights.bufferWeightsSize
- [in] buffer size of model's trained weights.@ByVal public static Net readFromModelOptimizer(@Cast(value="const uchar*") ByteBuffer bufferModelConfigPtr, @Cast(value="size_t") long bufferModelConfigSize, @Cast(value="const uchar*") ByteBuffer bufferWeightsPtr, @Cast(value="size_t") long bufferWeightsSize)
@ByVal public static Net readFromModelOptimizer(@Cast(value="const uchar*") byte[] bufferModelConfigPtr, @Cast(value="size_t") long bufferModelConfigSize, @Cast(value="const uchar*") byte[] bufferWeightsPtr, @Cast(value="size_t") long bufferWeightsSize)
@Cast(value="bool") public boolean empty()
@opencv_core.Str public BytePointer dump()
public void dumpToFile(@opencv_core.Str BytePointer path)
path
- path to output file with .dot extensiondump()
public void dumpToFile(@opencv_core.Str String path)
public int addLayer(@opencv_core.Str BytePointer name, @opencv_core.Str BytePointer type, @ByRef LayerParams params)
name
- unique name of the adding layer.type
- typename of the adding layer (type must be registered in LayerRegister).params
- parameters which will be used to initialize the creating layer.public int addLayer(@opencv_core.Str String name, @opencv_core.Str String type, @ByRef LayerParams params)
public int addLayerToPrev(@opencv_core.Str BytePointer name, @opencv_core.Str BytePointer type, @ByRef LayerParams params)
addLayer()
public int addLayerToPrev(@opencv_core.Str String name, @opencv_core.Str String type, @ByRef LayerParams params)
public int getLayerId(@opencv_core.Str BytePointer layer)
public int getLayerId(@opencv_core.Str String layer)
@ByVal public StringVector getLayerNames()
@opencv_core.Ptr public Layer getLayer(@ByVal @Cast(value="cv::dnn::Net::LayerId*") DictValue layerId)
public void connect(@opencv_core.Str BytePointer outPin, @opencv_core.Str BytePointer inpPin)
outPin
- descriptor of the first layer output.inpPin
- descriptor of the second layer input.
Descriptors have the following template <layer_name>[.input_number]:
- the first part of the template layer_name is string name of the added layer.
If this part is empty then the network input pseudo layer will be used;
- the second optional part of the template input_number
is either number of the layer input, either label one.
If this part is omitted then the first layer input will be used.setNetInputs(), Layer::inputNameToIndex(), Layer::outputNameToIndex()
public void connect(@opencv_core.Str String outPin, @opencv_core.Str String inpPin)
public void connect(int outLayerId, int outNum, int inpLayerId, int inpNum)
outLayerId
- identifier of the first layeroutNum
- number of the first layer outputinpLayerId
- identifier of the second layerinpNum
- number of the second layer inputpublic void setInputsNames(@Const @ByRef StringVector inputBlobNames)
public void setInputShape(@opencv_core.Str BytePointer inputName, @Const @StdVector @ByRef IntPointer shape)
public void setInputShape(@opencv_core.Str String inputName, @Const @StdVector @ByRef IntPointer shape)
@ByVal public Mat forward(@opencv_core.Str BytePointer outputName)
outputName
- name for layer which output is needed to get@ByVal public Mat forward(@opencv_core.Str String outputName)
@ByVal public AsyncArray forwardAsync(@opencv_core.Str BytePointer outputName)
outputName
- name for layer which output is needed to get
\details By default runs forward pass for the whole network.
This is an asynchronous version of forward(const String&).
dnn::DNN_BACKEND_INFERENCE_ENGINE backend is required.@ByVal public AsyncArray forwardAsync()
@ByVal public AsyncArray forwardAsync(@opencv_core.Str String outputName)
public void forward(@ByVal MatVector outputBlobs, @opencv_core.Str BytePointer outputName)
outputBlobs
- contains all output blobs for specified layer.outputName
- name for layer which output is needed to get
\details If \p outputName is empty, runs forward pass for the whole network.public void forward(@ByVal UMatVector outputBlobs, @opencv_core.Str String outputName)
public void forward(@ByVal UMatVector outputBlobs)
public void forward(@ByVal GpuMatVector outputBlobs, @opencv_core.Str BytePointer outputName)
public void forward(@ByVal GpuMatVector outputBlobs)
public void forward(@ByVal MatVector outputBlobs, @opencv_core.Str String outputName)
public void forward(@ByVal UMatVector outputBlobs, @opencv_core.Str BytePointer outputName)
public void forward(@ByVal GpuMatVector outputBlobs, @opencv_core.Str String outputName)
public void forward(@ByVal MatVector outputBlobs, @Const @ByRef StringVector outBlobNames)
outputBlobs
- contains blobs for first outputs of specified layers.outBlobNames
- names for layers which outputs are needed to getpublic void forward(@ByVal UMatVector outputBlobs, @Const @ByRef StringVector outBlobNames)
public void forward(@ByVal GpuMatVector outputBlobs, @Const @ByRef StringVector outBlobNames)
@Name(value="forward") public void forwardAndRetrieve(@ByRef MatVectorVector outputBlobs, @Const @ByRef StringVector outBlobNames)
outputBlobs
- contains all output blobs for each layer specified in \p outBlobNames.outBlobNames
- names for layers which outputs are needed to getpublic void setHalideScheduler(@opencv_core.Str BytePointer scheduler)
scheduler
- [in] Path to YAML file with scheduling directives.Schedule layers that support Halide backend. Then compile them for
specific target. For layers that not represented in scheduling file
or if no manual scheduling used at all, automatic scheduling will be applied.
public void setHalideScheduler(@opencv_core.Str String scheduler)
public void setPreferableBackend(int backendId)
backendId
- [in] backend identifier.If OpenCV is compiled with Intel's Inference Engine library, DNN_BACKEND_DEFAULT
means DNN_BACKEND_INFERENCE_ENGINE. Otherwise it equals to DNN_BACKEND_OPENCV.
public void setPreferableTarget(int targetId)
targetId
- [in] target identifier.List of supported combinations backend / target:
| | DNN_BACKEND_OPENCV | DNN_BACKEND_INFERENCE_ENGINE | DNN_BACKEND_HALIDE | DNN_BACKEND_CUDA |
|------------------------|--------------------|------------------------------|--------------------|-------------------|
| DNN_TARGET_CPU | + | + | + | |
| DNN_TARGET_OPENCL | + | + | + | |
| DNN_TARGET_OPENCL_FP16 | + | + | | |
| DNN_TARGET_MYRIAD | | + | | |
| DNN_TARGET_FPGA | | + | | |
| DNN_TARGET_CUDA | | | | + |
| DNN_TARGET_CUDA_FP16 | | | | + |
public void setInput(@ByVal Mat blob, @opencv_core.Str BytePointer name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
blob
- A new blob. Should have CV_32F or CV_8U depth.name
- A name of input layer.scalefactor
- An optional normalization scale.mean
- An optional mean subtraction values.to know format of the descriptor.
If scale or mean values are specified, a final input blob is computed
as:
{@code \[input(n,c,h,w) = scalefactor \times (blob(n,c,h,w) - mean_c)\]}
public void setInput(@ByVal Mat blob, @opencv_core.Str String name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
public void setInput(@ByVal UMat blob, @opencv_core.Str String name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
public void setInput(@ByVal UMat blob, @opencv_core.Str BytePointer name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
public void setInput(@ByVal GpuMat blob, @opencv_core.Str BytePointer name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
public void setInput(@ByVal GpuMat blob, @opencv_core.Str String name, double scalefactor, @Const @ByRef(nullValue="cv::Scalar()") Scalar mean)
public void setParam(@ByVal @Cast(value="cv::dnn::Net::LayerId*") DictValue layer, int numParam, @Const @ByRef Mat blob)
layer
- name or id of the layer.numParam
- index of the layer parameter in the Layer::blobs array.blob
- the new value.\note If shape of the new blob differs from the previous shape,
then the following forward pass may fail.
@ByVal public Mat getParam(@ByVal @Cast(value="cv::dnn::Net::LayerId*") DictValue layer, int numParam)
layer
- name or id of the layer.numParam
- index of the layer parameter in the Layer::blobs array.Layer::blobs
@StdVector public IntPointer getUnconnectedOutLayers()
@ByVal public StringVector getUnconnectedOutLayersNames()
public void getLayersShapes(@Const @ByRef MatShapeVector netInputShapes, @StdVector IntPointer layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
netInputShapes
- shapes for all input blobs in net input layer.layersIds
- output parameter for layer IDs.inLayersShapes
- output parameter for input layers shapes;
order is the same as in layersIdsoutLayersShapes
- output parameter for output layers shapes;
order is the same as in layersIdspublic void getLayersShapes(@Const @ByRef MatShapeVector netInputShapes, @StdVector IntBuffer layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
public void getLayersShapes(@Const @ByRef MatShapeVector netInputShapes, @StdVector int[] layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
public void getLayersShapes(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector IntPointer layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
public void getLayersShapes(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector IntBuffer layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
public void getLayersShapes(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector int[] layersIds, @ByRef MatShapeVectorVector inLayersShapes, @ByRef MatShapeVectorVector outLayersShapes)
public void getLayerShapes(@Const @StdVector @ByRef IntPointer netInputShape, int layerId, @ByRef MatShapeVector inLayerShapes, @ByRef MatShapeVector outLayerShapes)
netInputShape
- shape input blob in net input layer.layerId
- id for layer.inLayerShapes
- output parameter for input layers shapes;
order is the same as in layersIdsoutLayerShapes
- output parameter for output layers shapes;
order is the same as in layersIdspublic void getLayerShapes(@Const @ByRef MatShapeVector netInputShapes, int layerId, @ByRef MatShapeVector inLayerShapes, @ByRef MatShapeVector outLayerShapes)
@Cast(value="int64") public long getFLOPS(@Const @ByRef MatShapeVector netInputShapes)
netInputShapes
- vector of shapes for all net inputs.@Cast(value="int64") public long getFLOPS(@Const @StdVector @ByRef IntPointer netInputShape)
@Cast(value="int64") public long getFLOPS(int layerId, @Const @ByRef MatShapeVector netInputShapes)
@Cast(value="int64") public long getFLOPS(int layerId, @Const @StdVector @ByRef IntPointer netInputShape)
public void getLayerTypes(@ByRef StringVector layersTypes)
layersTypes
- output parameter for returning types.public int getLayersCount(@opencv_core.Str BytePointer layerType)
layerType
- type.public int getLayersCount(@opencv_core.Str String layerType)
public void getMemoryConsumption(@Const @ByRef MatShapeVector netInputShapes, @Cast(value="size_t*") @ByRef SizeTPointer weights, @Cast(value="size_t*") @ByRef SizeTPointer blobs)
netInputShapes
- vector of shapes for all net inputs.weights
- output parameter to store resulting bytes for weights.blobs
- output parameter to store resulting bytes for intermediate blobs.public void getMemoryConsumption(@Const @StdVector @ByRef IntPointer netInputShape, @Cast(value="size_t*") @ByRef SizeTPointer weights, @Cast(value="size_t*") @ByRef SizeTPointer blobs)
public void getMemoryConsumption(int layerId, @Const @ByRef MatShapeVector netInputShapes, @Cast(value="size_t*") @ByRef SizeTPointer weights, @Cast(value="size_t*") @ByRef SizeTPointer blobs)
public void getMemoryConsumption(int layerId, @Const @StdVector @ByRef IntPointer netInputShape, @Cast(value="size_t*") @ByRef SizeTPointer weights, @Cast(value="size_t*") @ByRef SizeTPointer blobs)
public void getMemoryConsumption(@Const @ByRef MatShapeVector netInputShapes, @StdVector IntPointer layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
netInputShapes
- vector of shapes for all net inputs.layerIds
- output vector to save layer IDs.weights
- output parameter to store resulting bytes for weights.blobs
- output parameter to store resulting bytes for intermediate blobs.public void getMemoryConsumption(@Const @ByRef MatShapeVector netInputShapes, @StdVector IntBuffer layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
public void getMemoryConsumption(@Const @ByRef MatShapeVector netInputShapes, @StdVector int[] layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
public void getMemoryConsumption(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector IntPointer layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
public void getMemoryConsumption(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector IntBuffer layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
public void getMemoryConsumption(@Const @StdVector @ByRef IntPointer netInputShape, @StdVector int[] layerIds, @Cast(value="size_t*") @StdVector SizeTPointer weights, @Cast(value="size_t*") @StdVector SizeTPointer blobs)
public void enableFusion(@Cast(value="bool") boolean fusion)
fusion
- true to enable the fusion, false to disable. The fusion is enabled by default.@Cast(value="int64") public long getPerfProfile(@StdVector DoublePointer timings)
timings
- vector for tick timings for all layers.@Cast(value="int64") public long getPerfProfile(@StdVector DoubleBuffer timings)
@Cast(value="int64") public long getPerfProfile(@StdVector double[] timings)
Copyright © 2020. All rights reserved.