OpenCV
4.8.0
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 &model_path, const std::string &bin_path, const std::string &device) | |
Class constructor. More... | |
Params (const std::string &blob_path, const std::string &device) | |
GBackend | backend () const |
Params< Net > & | cfgInputLayers (const std::vector< std::string > &layer_names) |
Specifies sequence of network input layers names for inference. More... | |
Params< Net > & | cfgInputModelLayout (std::string layout) |
Specifies model layout for an input layer. More... | |
Params< Net > & | cfgInputModelLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgInputTensorLayout (std::string layout) |
Specifies tensor layout for an input layer. More... | |
Params< Net > & | cfgInputTensorLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgMean (std::vector< float > mean_values) |
Specifies mean values for preprocessing. More... | |
Params< Net > & | cfgMean (detail::AttrMap< std::vector< float >> mean_map) |
Params< Net > & | cfgNumRequests (const size_t nireq) |
Specifies number of asynchronous inference requests. More... | |
Params< Net > & | cfgOutputLayers (const std::vector< std::string > &layer_names) |
Specifies sequence of network output layers names for inference. More... | |
Params< Net > & | cfgOutputModelLayout (std::string layout) |
Specifies model layout for an output layer. More... | |
Params< Net > & | cfgOutputModelLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgOutputTensorLayout (std::string layout) |
Specifies tensor layout for an output layer. More... | |
Params< Net > & | cfgOutputTensorLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgOutputTensorPrecision (int precision) |
Specifies tensor precision for an output layer. More... | |
Params< Net > & | cfgOutputTensorPrecision (detail::AttrMap< int > precision_map) |
Params< Net > & | cfgPluginConfig (const detail::ParamDesc::PluginConfigT &config) |
Specifies OpenVINO plugin configuration. More... | |
Params< Net > & | cfgReshape (std::vector< size_t > new_shape) |
Specifies the new shape for input layers. More... | |
Params< Net > & | cfgReshape (detail::AttrMap< std::vector< size_t >> new_shape_map) |
Params< Net > & | cfgResize (int interpolation) |
Specifies resize interpolation algorithm. More... | |
Params< Net > & | cfgResize (detail::AttrMap< int > interpolation) |
Params< Net > & | cfgScale (std::vector< float > scale_values) |
Specifies scale values for preprocessing. More... | |
Params< Net > & | cfgScale (detail::AttrMap< std::vector< float >> scale_map) |
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 |
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 |
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 model layout ("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.
layout_map | Map of pairs: name of corresponding input layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
|
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 |
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 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 |
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 model layout ("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.
layout_map | Map of pairs: name of corresponding output layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
|
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 |
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 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 |
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.
new_shape_map | Map of pairs: name of corresponding output layer and its new shape. |
|
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.
interpolation | Map of pairs: name of corresponding input layer and its resize algorithm. |
|
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 |
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 |
|
inline |
|
protected |