OpenCV
4.10.0
Open Source Computer Vision
|
This structure provides functions that fill inference parameters for "OpenVINO Toolkit" model. More...
#include <opencv2/gapi/infer/ie.hpp>
Public Member Functions | |
Params (const std::string &model, const std::string &device) | |
Params (const std::string &model, const std::string &weights, const std::string &device) | |
Class constructor. | |
GBackend | backend () const |
Params< Net > & | cfgBatchSize (const size_t size) |
Specifies the inference batch size. | |
Params & | cfgContextParams (const cv::util::any &ctx_cfg) |
Specifies configuration for RemoteContext in InferenceEngine. | |
Params & | cfgContextParams (cv::util::any &&ctx_cfg) |
Params< Net > & | cfgInferMode (InferMode mode) |
Specifies which api will be used to run inference. | |
Params< Net > & | cfgInputLayers (const typename PortCfg< Net >::In &layer_names) |
Specifies sequence of network input layers names for inference. | |
Params< Net > & | cfgInputLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgInputLayout (std::string layout) |
Specifies the input layout for model. | |
Params< Net > & | cfgInputReshape (const std::map< std::string, std::vector< std::size_t > > &reshape_table) |
Specifies new input shapes for the network inputs. | |
Params< Net > & | cfgInputReshape (const std::string &layer_name, const std::vector< size_t > &layer_dims) |
Params< Net > & | cfgInputReshape (const std::unordered_set< std::string > &layer_names) |
Params< Net > & | cfgInputReshape (std::map< std::string, std::vector< std::size_t > > &&reshape_table) |
Params< Net > & | cfgInputReshape (std::string &&layer_name, std::vector< size_t > &&layer_dims) |
Params< Net > & | cfgInputReshape (std::unordered_set< std::string > &&layer_names) |
Params & | cfgNumRequests (size_t nireq) |
Specifies number of asynchronous inference requests. | |
Params< Net > & | cfgOutputLayers (const typename PortCfg< Net >::Out &layer_names) |
Specifies sequence of network output layers names for inference. | |
Params< Net > & | cfgOutputLayout (detail::AttrMap< std::string > layout_map) |
Params< Net > & | cfgOutputLayout (std::string layout) |
Specifies the output layout for model. | |
Params< Net > & | cfgOutputPrecision (detail::ParamDesc::PrecisionMapT precision_map) |
Params< Net > & | cfgOutputPrecision (detail::ParamDesc::PrecisionT precision) |
Specifies the output precision for model. | |
Params< Net > & | cfgPreprocessingParams (const cv::gapi::wip::onevpl::Device &device, const cv::gapi::wip::onevpl::Context &ctx) |
Params< Net > & | cfgResize (detail::AttrMap< int > interpolation) |
Params< Net > & | cfgResize (int interpolation) |
Specifies resize interpolation algorithm. | |
Params< Net > & | constInput (const std::string &layer_name, const cv::Mat &data, TraitAs hint=TraitAs::TENSOR) |
Specifies a constant input. | |
cv::util::any | params () const |
Params & | pluginConfig (const IEConfig &cfg) |
Specifies OpenVINO plugin configuration. | |
Params & | pluginConfig (IEConfig &&cfg) |
std::string | tag () const |
Protected Attributes | |
detail::ParamDesc | 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 to topology IR (.xml file). |
weights | Path to weights (.bin file). |
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.
model | Path to model. |
device | target device to use. |
|
inline |
|
inline |
Specifies the inference batch size.
The function is used to specify inference batch size. Follow https://docs.openvinotoolkit.org/latest/classInferenceEngine_1_1CNNNetwork.html#a8e9d19270a48aab50cb5b1c43eecb8e9 for additional information
size | batch size which will be used. |
|
inline |
Specifies configuration for RemoteContext in InferenceEngine.
When RemoteContext is configured the backend imports the networks using the context. It also expects cv::MediaFrames to be actually remote, to operate with blobs via the context.
ctx_cfg | cv::util::any value which holds InferenceEngine::ParamMap. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Function with an rvalue parameter.
ctx_cfg | cv::util::any value which holds InferenceEngine::ParamMap. |
|
inline |
Specifies which api will be used to run inference.
The function is used to specify mode for OpenVINO inference. OpenVINO has two options to run inference:
mode | Inference mode which will be used. |
|
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 layout in string representation ("NCHW", "NHWC", etc) |
|
inline |
Specifies the input layout for model.
The function is used to set an input layout for model.
layout | Layout in string representation ("NCHW", "NHWC", etc) will be applied to all input layers. |
|
inline |
Specifies new input shapes for the network inputs.
The function is used to specify new input shapes for the network inputs. Follow https://docs.openvinotoolkit.org/latest/classInferenceEngine_1_1networkNetwork.html for additional information.
reshape_table | Map of pairs: name of corresponding data and its dimension. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layer_name | Name of layer. |
layer_dims | New dimensions for this layer. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layer_names | set of names of network layers that will be used for network reshape. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
layer_names | rvalue set of the selected layers will be reshaped automatically its input image size. |
|
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 layout in string representation ("NCHW", "NHWC", etc) |
|
inline |
Specifies the output layout for model.
The function is used to set an output layout for model.
layout | Layout in string representation ("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.
precision_map | Map of pairs: name of corresponding output layer and its precision in OpenCV format (CV_8U, CV_32F, ...) |
|
inline |
Specifies the output precision for model.
The function is used to set an output precision for model.
precision | Precision in OpenCV format (CV_8U, CV_32F, ...) will be applied to all output layers. |
|
inline |
|
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_LINEAR, INTER_AREA. |
|
inline |
Specifies a constant input.
The function is used to set a constant input. This input has to be a preprocessed tensor if its type is TENSOR. Need to provide name of the network layer which will receive provided data.
layer_name | Name of network layer. |
data | cv::Mat that contains data which will be associated with network layer. |
hint | Input type |
|
inline |
|
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.
cfg | 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. Function with a rvalue parameter.
cfg | rvalue map of pairs: (config parameter name, config parameter value). |
|
inline |
|
protected |