[Net::setPreferableBackend]
DNN_BACKEND_DEFAULT equals to DNN_BACKEND_INFERENCE_ENGINE if OpenCV is built with Intel's Inference Engine library or DNN_BACKEND_OPENCV otherwise.
a set of bounding boxes to apply NMS.
a set of corresponding confidences.
a threshold used to filter boxes by score.
a threshold used in non maximum suppression.
the kept indices of bboxes after NMS.
a coefficient in adaptive threshold formula: $nms_threshold_{i+1}=eta\cdot nms_threshold_i$.
if >0, keep at most top_k picked indices.
if crop
is true, input image is resized so one side after resize is equal to corresponding
dimension in size
and another one is equal or larger. Then, crop from the center is performed. If
crop
is false, direct resize without cropping and preserving aspect ratio is performed.
4-dimensional [Mat] with NCHW dimensions order.
input image (with 1-, 3- or 4-channels).
multiplier for image values.
spatial size for output image
scalar with mean values which are subtracted from channels. Values are intended to be in (mean-R, mean-G, mean-B) order if image has BGR ordering and swapRB is true.
flag which indicates that swap first and last channels in 3-channel image is necessary.
flag which indicates whether image will be cropped after resize or not
Depth of output blob. Choose CV_32F or CV_8U.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
if crop
is true, input image is resized so one side after resize is equal to corresponding
dimension in size
and another one is equal or larger. Then, crop from the center is performed. If
crop
is false, direct resize without cropping and preserving aspect ratio is performed.
4-dimensional [Mat] with NCHW dimensions order.
input images (all with 1-, 3- or 4-channels).
multiplier for images values.
spatial size for output image
scalar with mean values which are subtracted from channels. Values are intended to be in (mean-R, mean-G, mean-B) order if image has BGR ordering and swapRB is true.
flag which indicates that swap first and last channels in 3-channel image is necessary.
flag which indicates whether image will be cropped after resize or not
Depth of output blob. Choose CV_32F or CV_8U.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
4 dimensional array (images, channels, height, width) in floating point precision (CV_32F) from which you would like to extract the images.
array of 2D Mat containing the images extracted from the blob in floating point precision (CV_32F). They are non normalized neither mean added. The number of returned images equals the first dimension of the blob (batch size). Every image has a number of channels equals to the second dimension of the blob (depth).
[Net] object.
This function automatically detects an origin framework of trained model and calls an appropriate
function such [readNetFromCaffe], [readNetFromTensorflow], [readNetFromTorch] or
[readNetFromDarknet]. An order of model
and config
arguments does not matter.
Binary file contains trained weights. The following file extensions are expected for models from different frameworks: .caffemodel (Caffe, http://caffe.berkeleyvision.org/)*.pb (TensorFlow, https://www.tensorflow.org/)*.t7 | .net (Torch, http://torch.ch/).weights (Darknet, https://pjreddie.com/darknet/)*.bin (DLDT, https://software.intel.com/openvino-toolkit)*.onnx (ONNX, https://onnx.ai/)
Text file contains network configuration. It could be a file with the following extensions: .prototxt (Caffe, http://caffe.berkeleyvision.org/)*.pbtxt (TensorFlow, https://www.tensorflow.org/)*.cfg (Darknet, https://pjreddie.com/darknet/)*.xml (DLDT, https://software.intel.com/openvino-toolkit)
Explicit framework name tag to determine a format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[Net] object.
Name of origin framework.
A buffer with a content of binary file with weights
A buffer with a content of text file contains network configuration.
[Net] object.
path to the .prototxt file with text description of the network architecture.
path to the .caffemodel file with learned network.
[Net] object.
buffer containing the content of the .prototxt file
buffer containing the content of the .caffemodel file
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[Net] object.
buffer containing the content of the .prototxt file
length of bufferProto
buffer containing the content of the .caffemodel file
length of bufferModel
Network object that ready to do forward, throw an exception in failure cases.
[Net] object.
path to the .cfg file with text description of the network architecture.
path to the .weights file with learned network.
[Net] object.
A buffer contains a content of .cfg file with text description of the network architecture.
A buffer contains a content of .weights file with learned network.
[Net] object.
A buffer contains a content of .cfg file with text description of the network architecture.
Number of bytes to read from bufferCfg
A buffer contains a content of .weights file with learned network.
Number of bytes to read from bufferModel
[Net] object. Networks imported from Intel's [Model] Optimizer are launched in Intel's Inference Engine backend.
XML configuration file with network's topology.
Binary file with trained weights.
Network object that ready to do forward, throw an exception in failure cases.
path to the .onnx file with text description of the network architecture.
Network object that ready to do forward, throw an exception in failure cases.
memory address of the first byte of the buffer.
size of the buffer.
Network object that ready to do forward, throw an exception in failure cases.
in-memory buffer that stores the ONNX model bytes.
[Net] object.
path to the .pb file with binary protobuf description of the network architecture
path to the .pbtxt file that contains text graph definition in protobuf format. Resulting Net object is built by text graph using weights from a binary one that let us make it more flexible.
[Net] object.
buffer containing the content of the pb file
buffer containing the content of the pbtxt file
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
buffer containing the content of the pb file
length of bufferModel
buffer containing the content of the pbtxt file
length of bufferConfig
[Net] object.
Ascii mode of Torch serializer is more preferable, because binary mode extensively use long
type
of C language, which has various bit-length on different systems.
The loading file must contain serialized object with importing network. Try to eliminate a custom
objects from serialazing data to avoid importing errors.
List of supported layers (i.e. object instances derived from Torch nn.Module class):
nn.Sequential nn.Parallel nn.Concat nn.Linear nn.SpatialConvolution nn.SpatialMaxPooling, nn.SpatialAveragePooling nn.ReLU, nn.TanH, nn.Sigmoid nn.Reshape nn.SoftMax, nn.LogSoftMax
Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported.
path to the file, dumped from Torch by using torch.save() function.
specifies whether the network was serialized in ascii mode or binary.
specifies testing phase of network. If true, it's similar to evaluate() method in Torch.
[Mat].
to the .pb file with input tensor.
Shrinked model has no origin float32 weights so it can't be used in origin Caffe framework anymore. However the structure of data is taken from NVidia's Caffe fork: . So the resulting model may be used there.
Path to origin model from Caffe framework contains single precision floating point weights (usually has .caffemodel extension).
Path to destination model with updated weights.
Set of layers types which parameters will be converted. By default, converts only Convolutional and Fully-Connected layers' weights.
To reduce output file size, trained weights are not included.
A path to binary network.
A path to output text file to be created.
Generated using TypeDoc
[Net::setPreferableBackend]