SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
SourceXtractor::OnnxModel Class Reference

#include <OnnxModel.h>

Collaboration diagram for SourceXtractor::OnnxModel:
Collaboration graph
[legend]

Public Member Functions

 OnnxModel (const std::string &model_path)
 
template<typename T , typename U >
void run (std::vector< T > &input_data, std::vector< U > &output_data) const
 
template<typename T , typename U >
void runMultiInput (std::map< std::string, std::vector< T >> &input_data, std::vector< U > &output_data) const
 
ONNXTensorElementDataType getInputType () const
 
ONNXTensorElementDataType getOutputType () const
 
const std::vector< std::int64_t > & getInputShape () const
 
const std::vector< std::int64_t > & getOutputShape () const
 
std::string getDomain () const
 
std::string getGraphName () const
 
std::string getInputName () const
 
std::string getOutputName () const
 
std::string getModelPath () const
 
size_t getInputNb () const
 
size_t getOutputNb () const
 

Private Attributes

std::string m_domain_name
 domain name More...
 
std::string m_graph_name
 graph name More...
 
std::vector< std::stringm_input_names
 Input tensor name. More...
 
std::string m_output_name
 Output tensor name. More...
 
std::vector
< ONNXTensorElementDataType > 
m_input_types
 Input type. More...
 
ONNXTensorElementDataType m_output_type
 Output type. More...
 
std::vector< std::vector
< std::int64_t > > 
m_input_shapes
 Input tensor shape. More...
 
std::vector< std::int64_tm_output_shape
 Output tensor shape. More...
 
std::string m_model_path
 Path to the ONNX model. More...
 
std::unique_ptr< Ort::Session > m_session
 Session, one per model. In theory, it is thread-safe. More...
 

Detailed Description

Definition at line 21 of file OnnxModel.h.

Constructor & Destructor Documentation

SourceXtractor::OnnxModel::OnnxModel ( const std::string model_path)
explicit

Member Function Documentation

std::string SourceXtractor::OnnxModel::getDomain ( ) const
inline

Definition at line 122 of file OnnxModel.h.

References m_domain_name.

Referenced by SourceXtractor::generatePropertyName().

std::string SourceXtractor::OnnxModel::getGraphName ( ) const
inline

Definition at line 126 of file OnnxModel.h.

References m_graph_name.

Referenced by SourceXtractor::generatePropertyName().

std::string SourceXtractor::OnnxModel::getInputName ( ) const
inline

Definition at line 130 of file OnnxModel.h.

References m_input_names.

size_t SourceXtractor::OnnxModel::getInputNb ( ) const
inline

Definition at line 142 of file OnnxModel.h.

References m_input_names, and std::vector< T >::size().

Referenced by SourceXtractor::MLSegmentation::labelImage().

Here is the call graph for this function:

const std::vector<std::int64_t>& SourceXtractor::OnnxModel::getInputShape ( ) const
inline
ONNXTensorElementDataType SourceXtractor::OnnxModel::getInputType ( ) const
inline

Definition at line 106 of file OnnxModel.h.

References m_input_types.

Referenced by SourceXtractor::MLSegmentation::labelImage().

std::string SourceXtractor::OnnxModel::getModelPath ( ) const
inline

Definition at line 138 of file OnnxModel.h.

References m_model_path.

std::string SourceXtractor::OnnxModel::getOutputName ( ) const
inline

Definition at line 134 of file OnnxModel.h.

References m_output_name.

Referenced by SourceXtractor::generatePropertyName().

size_t SourceXtractor::OnnxModel::getOutputNb ( ) const
inline

Definition at line 146 of file OnnxModel.h.

const std::vector<std::int64_t>& SourceXtractor::OnnxModel::getOutputShape ( ) const
inline
ONNXTensorElementDataType SourceXtractor::OnnxModel::getOutputType ( ) const
inline

Definition at line 110 of file OnnxModel.h.

References m_output_type.

Referenced by SourceXtractor::MLSegmentation::labelImage().

template<typename T , typename U >
void SourceXtractor::OnnxModel::run ( std::vector< T > &  input_data,
std::vector< U > &  output_data 
) const
inline
template<typename T , typename U >
void SourceXtractor::OnnxModel::runMultiInput ( std::map< std::string, std::vector< T >> &  input_data,
std::vector< U > &  output_data 
) const
inline

Member Data Documentation

std::string SourceXtractor::OnnxModel::m_domain_name
private

domain name

Definition at line 151 of file OnnxModel.h.

Referenced by getDomain(), and OnnxModel().

std::string SourceXtractor::OnnxModel::m_graph_name
private

graph name

Definition at line 152 of file OnnxModel.h.

Referenced by getGraphName(), and OnnxModel().

std::vector<std::string> SourceXtractor::OnnxModel::m_input_names
private

Input tensor name.

Definition at line 153 of file OnnxModel.h.

Referenced by getInputName(), getInputNb(), OnnxModel(), run(), and runMultiInput().

std::vector<std::vector<std::int64_t> > SourceXtractor::OnnxModel::m_input_shapes
private

Input tensor shape.

Definition at line 157 of file OnnxModel.h.

Referenced by getInputShape(), OnnxModel(), run(), and runMultiInput().

std::vector<ONNXTensorElementDataType> SourceXtractor::OnnxModel::m_input_types
private

Input type.

Definition at line 155 of file OnnxModel.h.

Referenced by getInputType(), and OnnxModel().

std::string SourceXtractor::OnnxModel::m_model_path
private

Path to the ONNX model.

Definition at line 159 of file OnnxModel.h.

Referenced by getModelPath(), and OnnxModel().

std::string SourceXtractor::OnnxModel::m_output_name
private

Output tensor name.

Definition at line 154 of file OnnxModel.h.

Referenced by getOutputName(), OnnxModel(), run(), and runMultiInput().

std::vector<std::int64_t> SourceXtractor::OnnxModel::m_output_shape
private

Output tensor shape.

Definition at line 158 of file OnnxModel.h.

Referenced by getOutputShape(), OnnxModel(), run(), and runMultiInput().

ONNXTensorElementDataType SourceXtractor::OnnxModel::m_output_type
private

Output type.

Definition at line 156 of file OnnxModel.h.

Referenced by getOutputType(), and OnnxModel().

std::unique_ptr<Ort::Session> SourceXtractor::OnnxModel::m_session
private

Session, one per model. In theory, it is thread-safe.

Definition at line 160 of file OnnxModel.h.

Referenced by OnnxModel(), run(), and runMultiInput().


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