OpenCV  4.5.2
Open Source Computer Vision
Public Member Functions | Protected Attributes | List of all members
cv::gapi::onnx::Params< Net > Class Template Reference

#include <opencv2/gapi/infer/onnx.hpp>

Public Member Functions

 Params (const std::string &model)
 
GBackend backend () const
 
Params< Net > & cfgInputLayers (const typename PortCfg< Net >::In &ll)
 
Params< Net > & cfgMeanStd (const typename PortCfg< Net >::NormCoefs &m, const typename PortCfg< Net >::NormCoefs &s)
 
Params< Net > & cfgNormalize (const typename PortCfg< Net >::Normalize &n)
 
Params< Net > & cfgOutputLayers (const typename PortCfg< Net >::Out &ll)
 
Params< Net > & cfgPostProc (const std::vector< cv::GMatDesc > &out_metas, const PostProc &pp)
 Configures graph output and sets the post processing function from user. More...
 
Params< Net > & cfgPostProc (std::vector< cv::GMatDesc > &&out_metas, PostProc &&pp)
 
Params< Net > & cfgPostProc (const std::vector< cv::GMatDesc > &out_metas, const PostProc &pp, const std::vector< std::string > &names_to_remap)
 
Params< Net > & cfgPostProc (std::vector< cv::GMatDesc > &&out_metas, PostProc &&pp, std::vector< std::string > &&names_to_remap)
 
Params< Net > & constInput (const std::string &layer_name, const cv::Mat &data, TraitAs hint=TraitAs::TENSOR)
 
cv::util::any params () const
 
std::string tag () const
 

Protected Attributes

detail::ParamDesc desc
 

Constructor & Destructor Documentation

◆ Params()

template<typename Net >
cv::gapi::onnx::Params< Net >::Params ( const std::string &  model)
inline

Member Function Documentation

◆ backend()

template<typename Net >
GBackend cv::gapi::onnx::Params< Net >::backend ( ) const
inline

◆ cfgInputLayers()

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgInputLayers ( const typename PortCfg< Net >::In &  ll)
inline

◆ cfgMeanStd()

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgMeanStd ( const typename PortCfg< Net >::NormCoefs &  m,
const typename PortCfg< Net >::NormCoefs &  s 
)
inline

◆ cfgNormalize()

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgNormalize ( const typename PortCfg< Net >::Normalize &  n)
inline

◆ cfgOutputLayers()

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgOutputLayers ( const typename PortCfg< Net >::Out &  ll)
inline

◆ cfgPostProc() [1/4]

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgPostProc ( const std::vector< cv::GMatDesc > &  out_metas,
const PostProc pp 
)
inline

Configures graph output and sets the post processing function from user.

The function is used for the case of infer of networks with dynamic outputs. Since these networks haven't known output parameters needs provide them for construction of output of graph. The function provides meta information of outputs and post processing function. Post processing function is used for copy information from ONNX infer's result to output of graph which is allocated by out meta information.

Parameters
out_metasout meta information.
pppost processing function, which has two parameters. First is onnx result, second is graph output. Both parameters is std::map that contain pair of layer's name and cv::Mat.
Returns
reference to object of class Params.

◆ cfgPostProc() [2/4]

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgPostProc ( std::vector< cv::GMatDesc > &&  out_metas,
PostProc &&  pp 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The function has rvalue parameters.

◆ cfgPostProc() [3/4]

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgPostProc ( const std::vector< cv::GMatDesc > &  out_metas,
const PostProc pp,
const std::vector< std::string > &  names_to_remap 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The function has additional parameter names_to_remap. This parameter provides information about output layers which will be used for infer and in post processing function.

Parameters
out_metasout meta information.
pppost processing function.
names_to_remapcontains names of output layers. CNN's infer will be done on these layers. Infer's result will be processed in post processing function using these names.
Returns
reference to object of class Params.

◆ cfgPostProc() [4/4]

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::cfgPostProc ( std::vector< cv::GMatDesc > &&  out_metas,
PostProc &&  pp,
std::vector< std::string > &&  names_to_remap 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The function has rvalue parameters.

◆ constInput()

template<typename Net >
Params<Net>& cv::gapi::onnx::Params< Net >::constInput ( const std::string &  layer_name,
const cv::Mat data,
TraitAs  hint = TraitAs::TENSOR 
)
inline

◆ params()

template<typename Net >
cv::util::any cv::gapi::onnx::Params< Net >::params ( ) const
inline

◆ tag()

template<typename Net >
std::string cv::gapi::onnx::Params< Net >::tag ( ) const
inline

Member Data Documentation

◆ desc

template<typename Net >
detail::ParamDesc cv::gapi::onnx::Params< Net >::desc
protected

The documentation for this class was generated from the following file: