This structure provides functions that fill inference parameters for "OpenVINO Toolkit" model.
More...
#include <opencv2/gapi/infer/ov.hpp>
template<typename Net>
struct cv::gapi::ov::Params< Net >
This structure provides functions that fill inference parameters for "OpenVINO Toolkit" model.
◆ Params() [1/2]
template<typename Net >
cv::gapi::ov::Params< Net >::Params |
( |
const std::string & | model_path, |
|
|
const std::string & | bin_path, |
|
|
const std::string & | device ) |
|
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".
- Parameters
-
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. |
◆ Params() [2/2]
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.
- Parameters
-
blob_path | path to the compiled model (*.blob). |
device | target device to use. |
◆ backend()
◆ cfgEnsureNamedTensors()
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.
- Parameters
-
flag | If true, then it guarantees that all tensors will have names. |
- Returns
- reference to this parameter structure.
◆ cfgInputLayers()
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.
- Parameters
-
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. |
- Returns
- reference to this parameter structure.
◆ cfgInputModelLayout() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
layout_map | Map of pairs: name of corresponding input layer and its model layout ("NCHW", "NHWC", etc) |
- Returns
- reference to this parameter structure.
◆ cfgInputModelLayout() [2/2]
Specifies model layout for an input layer.
The function is used to set model layout for an input layer.
- Parameters
-
layout | Model layout ("NCHW", "NHWC", etc) will be applied to all input layers. |
- Returns
- reference to this parameter structure.
◆ cfgInputTensorLayout() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
layout_map | Map of pairs: name of corresponding input layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
- Returns
- reference to this parameter structure.
◆ cfgInputTensorLayout() [2/2]
Specifies tensor layout for an input layer.
The function is used to set tensor layout for an input layer.
- Parameters
-
layout | Tensor layout ("NCHW", "NWHC", etc) will be applied to all input layers. |
- Returns
- reference to this parameter structure.
◆ cfgMean() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
mean_map | Map of pairs: name of corresponding input layer and its mean values. |
- Returns
- reference to this parameter structure.
◆ cfgMean() [2/2]
Specifies mean values for preprocessing.
The function is used to set mean values for input layer preprocessing.
- Parameters
-
mean_values | Float vector contains mean values |
- Returns
- reference to this parameter structure.
◆ cfgNumRequests()
Specifies number of asynchronous inference requests.
- Parameters
-
nireq | Number of inference asynchronous requests. |
- Returns
- reference to this parameter structure.
◆ cfgOutputLayers()
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.
- Parameters
-
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. |
- Returns
- reference to this parameter structure.
◆ cfgOutputModelLayout() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
layout_map | Map of pairs: name of corresponding output layer and its model layout ("NCHW", "NHWC", etc) |
- Returns
- reference to this parameter structure.
◆ cfgOutputModelLayout() [2/2]
Specifies model layout for an output layer.
The function is used to set model layout for an output layer.
- Parameters
-
layout | Model layout ("NCHW", "NHWC", etc) will be applied to all output layers. |
- Returns
- reference to this parameter structure.
◆ cfgOutputTensorLayout() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
layout_map | Map of pairs: name of corresponding output layer and its tensor layout represented in std::string ("NCHW", "NHWC", etc) |
- Returns
- reference to this parameter structure.
◆ cfgOutputTensorLayout() [2/2]
Specifies tensor layout for an output layer.
The function is used to set tensor layout for an output layer.
- Parameters
-
layout | Tensor layout ("NCHW", "NWHC", etc) will be applied to all output layers. |
- Returns
- reference to this parameter structure.
◆ cfgOutputTensorPrecision() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
precision_map | Map of pairs: name of corresponding output layer and its precision in OpenCV format (CV_8U, CV_32F, ...) |
- Returns
- reference to this parameter structure.
◆ cfgOutputTensorPrecision() [2/2]
Specifies tensor precision for an output layer.
The function is used to set tensor precision for an output layer..
- Parameters
-
precision | Precision in OpenCV format (CV_8U, CV_32F, ...) will be applied to all output layers. |
- Returns
- reference to this parameter structure.
◆ cfgPluginConfig()
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.
- Parameters
-
config | Map of pairs: (config parameter name, config parameter value). |
- Returns
- reference to this parameter structure.
◆ cfgReshape() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
new_shape_map | Map of pairs: name of corresponding output layer and its new shape. |
- Returns
- reference to this parameter structure.
◆ cfgReshape() [2/2]
Specifies the new shape for input layers.
The function is used to set new shape for input layers.
- Parameters
-
new_shape | New shape will be applied to all input layers. |
- Returns
- reference to this parameter structure.
◆ cfgResize() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
interpolation | Map of pairs: name of corresponding input layer and its resize algorithm. |
- Returns
- reference to this parameter structure.
◆ cfgResize() [2/2]
Specifies resize interpolation algorithm.
The function is used to configure resize preprocessing for input layer.
- Parameters
-
- Returns
- reference to this parameter structure.
◆ cfgScale() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
scale_map | Map of pairs: name of corresponding input layer and its mean values. |
- Returns
- reference to this parameter structure.
◆ cfgScale() [2/2]
Specifies scale values for preprocessing.
The function is used to set scale values for input layer preprocessing.
- Parameters
-
scale_values | Float vector contains scale values |
- Returns
- reference to this parameter structure.
◆ params()
◆ tag()
◆ m_desc
The documentation for this struct was generated from the following file: