![]() |
OpenCV 4.13.0-dev
Open Source Computer Vision
|
This structure provides functions that fill inference parameters for "OpenVINO Toolkit" model. More...
#include <opencv2/gapi/infer/ov.hpp>
Public Member Functions | |
Params (const std::string &blob_path, const std::string &device) | |
Params (const std::string &model_path, const std::string &bin_path, const std::string &device) | |
Class constructor. | |
GBackend | backend () const |
Params< Net > & | cfgClampOutputs (bool flag=true) |
Enables or disables clamping of model outputs in the PrePostProcessor. | |
Params< Net > & | cfgEnsureNamedTensors (bool flag=true) |
Ensures the model has named tensors. | |
Params< Net > & | cfgInputLayers (const std::vector< std::string > &layer_names) |
Specifies sequence of network input layers names for inference. | |
Params< Net > & | cfgInputModelLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgInputModelLayout (std::string layout) |
Specifies model layout for an input layer. | |
Params< Net > & | cfgInputTensorLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgInputTensorLayout (std::string layout) |
Specifies tensor layout for an input layer. | |
Params< Net > & | cfgMean (detail::AttrMap< std::vector< float > > mean_map) |
Params< Net > & | cfgMean (std::vector< float > mean_values) |
Specifies mean values for preprocessing. | |
Params< Net > & | cfgNumRequests (const size_t nireq) |
Specifies number of asynchronous inference requests. | |
Params< Net > & | cfgOutputLayers (const std::vector< std::string > &layer_names) |
Specifies sequence of network output layers names for inference. | |
Params< Net > & | cfgOutputModelLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgOutputModelLayout (std::string layout) |
Specifies model layout for an output layer. | |
Params< Net > & | cfgOutputTensorLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgOutputTensorLayout (std::string layout) |
Specifies tensor layout for an output layer. | |
Params< Net > & | cfgOutputTensorPrecision (detail::AttrMap< int > precision_map) |
Params< Net > & | cfgOutputTensorPrecision (int precision) |
Specifies tensor precision for an output layer. | |
Params< Net > & | cfgPluginConfig (const detail::ParamDesc::PluginConfigT &config) |
Specifies OpenVINO plugin configuration. | |
Params< Net > & | cfgReshape (detail::AttrMap< std::vector< size_t > > new_shape_map) |
Params< Net > & | cfgReshape (std::vector< size_t > new_shape) |
Specifies the new shape for input layers. | |
Params< Net > & | cfgResize (detail::AttrMap< int > interpolation) |
Params< Net > & | cfgResize (int interpolation) |
Specifies resize interpolation algorithm. | |
Params< Net > & | cfgScale (detail::AttrMap< std::vector< float > > scale_map) |
Params< Net > & | cfgScale (std::vector< float > scale_values) |
Specifies scale values for preprocessing. | |
cv::util::any | params () const |
std::string | tag () const |
Protected Attributes | |
detail::ParamDesc | m_desc |
This structure provides functions that fill inference parameters for "OpenVINO Toolkit" model.
|
inline |
Class constructor.
Constructs Params based on model information and specifies default values for other inference description parameters. Model is loaded and compiled using "OpenVINO Toolkit".
model_path | Path to a model. |
bin_path | Path to a data file. For IR format (*.bin): If path is empty, will try to read a bin file with the same name as xml. If the bin file with the same name is not found, will load IR without weights. For PDPD (*.pdmodel) and ONNX (*.onnx) formats bin_path isn't used. |
device | target device to use. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Use this constructor to work with pre-compiled network. Model is imported from a pre-compiled blob.
blob_path | path to the compiled model (*.blob). |
device | target device to use. |
|
inline |
|
inline |
Enables or disables clamping of model outputs in the PrePostProcessor.
By default, output values are clamped to the valid range for the output precision by the device or plugin. Enabling this option moves clamping to the PrePostProcessor stage.
flag | If true, clamping is performed in the PrePostProcessor; otherwise, it is handled by the device or plugin. |
|
inline |
Ensures the model has named tensors.
This function is used to ensure that all tensors in the model have names. It goes through all input and output nodes of the model and sets the names if they are not set. This is neccessary for models with nameless tensors.
If a tensor does not have a name, it will be assigned a default name based on the producer node's friendly name. If the producer node has multiple outputs, the name will be in the form "node_name:N", where N is the output index.
flag | If true, then it guarantees that all tensors will have names. |
|
inline |
Specifies sequence of network input layers names for inference.
The function is used to associate cv::gapi::infer<> inputs with the model inputs. Number of names has to match the number of network inputs as defined in G_API_NET(). In case a network has only single input layer, there is no need to specify name manually.
layer_names | std::array<std::string, N> where N is the number of inputs as defined in the G_API_NET. Contains names of input layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layout_map | Map of pairs: name of corresponding input layer and its model layout ("NCHW", "NHWC", etc) |
|
inline |
Specifies model layout for an input layer.
The function is used to set model layout for an input layer.
layout | Model layout ("NCHW", "NHWC", etc) will be applied to all input layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layout_map | Map of pairs: name of corresponding input layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
|
inline |
Specifies tensor layout for an input layer.
The function is used to set tensor layout for an input layer.
layout | Tensor layout ("NCHW", "NWHC", etc) will be applied to all input layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
mean_map | Map of pairs: name of corresponding input layer and its mean values. |
|
inline |
Specifies mean values for preprocessing.
The function is used to set mean values for input layer preprocessing.
mean_values | Float vector contains mean values |
|
inline |
Specifies number of asynchronous inference requests.
nireq | Number of inference asynchronous requests. |
|
inline |
Specifies sequence of network output layers names for inference.
The function is used to associate cv::gapi::infer<> outputs with the model outputs. Number of names has to match the number of network outputs as defined in G_API_NET(). In case a network has only single output layer, there is no need to specify name manually.
layer_names | std::array<std::string, N> where N is the number of outputs as defined in the G_API_NET. Contains names of output layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layout_map | Map of pairs: name of corresponding output layer and its model layout ("NCHW", "NHWC", etc) |
|
inline |
Specifies model layout for an output layer.
The function is used to set model layout for an output layer.
layout | Model layout ("NCHW", "NHWC", etc) will be applied to all output layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layout_map | Map of pairs: name of corresponding output layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
|
inline |
Specifies tensor layout for an output layer.
The function is used to set tensor layout for an output layer.
layout | Tensor layout ("NCHW", "NWHC", etc) will be applied to all output layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
precision_map | Map of pairs: name of corresponding output layer and its precision in OpenCV format (CV_8U, CV_32F, ...) |
|
inline |
Specifies tensor precision for an output layer.
The function is used to set tensor precision for an output layer..
precision | Precision in OpenCV format (CV_8U, CV_32F, ...) will be applied to all output layers. |
|
inline |
Specifies OpenVINO plugin configuration.
The function is used to set configuration for OpenVINO plugin. Some parameters can be different for each plugin. Please follow https://docs.openvinotoolkit.org/latest/index.html to check information about specific plugin.
config | Map of pairs: (config parameter name, config parameter value). |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
new_shape_map | Map of pairs: name of corresponding output layer and its new shape. |
|
inline |
Specifies the new shape for input layers.
The function is used to set new shape for input layers.
new_shape | New shape will be applied to all input layers. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
interpolation | Map of pairs: name of corresponding input layer and its resize algorithm. |
|
inline |
Specifies resize interpolation algorithm.
The function is used to configure resize preprocessing for input layer.
interpolation | Resize interpolation algorithm. Supported algorithms: INTER_NEAREST, INTER_LINEAR, INTER_CUBIC. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
scale_map | Map of pairs: name of corresponding input layer and its mean values. |
|
inline |
Specifies scale values for preprocessing.
The function is used to set scale values for input layer preprocessing.
scale_values | Float vector contains scale values |
|
inline |
|
inline |
|
protected |