SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::OnnxModel Class Reference

#include <OnnxModel.h>

Collaboration diagram for SourceXtractor::OnnxModel:

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

Detailed Description

Definition at line 23 of file OnnxModel.h.

Constructor & Destructor Documentation

◆ OnnxModel()

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

Member Function Documentation

◆ getDomain()

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

Definition at line 124 of file OnnxModel.h.

References m_domain_name.

Referenced by SourceXtractor::generatePropertyName().

◆ getGraphName()

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

Definition at line 128 of file OnnxModel.h.

References m_graph_name.

Referenced by SourceXtractor::generatePropertyName().

◆ getInputName()

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

Definition at line 132 of file OnnxModel.h.

References m_input_names.

◆ getInputNb()

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

Definition at line 144 of file OnnxModel.h.

References m_input_names.

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

◆ getInputShape()

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

◆ getInputType()

ONNXTensorElementDataType SourceXtractor::OnnxModel::getInputType ( ) const
inline

Definition at line 108 of file OnnxModel.h.

References m_input_types.

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

◆ getModelPath()

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

Definition at line 140 of file OnnxModel.h.

References m_model_path.

◆ getOutputName()

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

Definition at line 136 of file OnnxModel.h.

References m_output_name.

Referenced by SourceXtractor::generatePropertyName().

◆ getOutputNb()

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

Definition at line 148 of file OnnxModel.h.

◆ getOutputShape()

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

◆ getOutputType()

ONNXTensorElementDataType SourceXtractor::OnnxModel::getOutputType ( ) const
inline

Definition at line 112 of file OnnxModel.h.

References m_output_type.

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

◆ run()

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

◆ runMultiInput()

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

◆ m_domain_name

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

domain name

Definition at line 153 of file OnnxModel.h.

Referenced by getDomain(), and OnnxModel().

◆ m_graph_name

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

graph name

Definition at line 154 of file OnnxModel.h.

Referenced by getGraphName(), and OnnxModel().

◆ m_input_names

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

Input tensor name.

Definition at line 155 of file OnnxModel.h.

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

◆ m_input_shapes

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

Input tensor shape.

Definition at line 159 of file OnnxModel.h.

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

◆ m_input_types

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

Input type.

Definition at line 157 of file OnnxModel.h.

Referenced by getInputType(), and OnnxModel().

◆ m_model_path

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

Path to the ONNX model.

Definition at line 161 of file OnnxModel.h.

Referenced by getModelPath(), and OnnxModel().

◆ m_output_name

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

Output tensor name.

Definition at line 156 of file OnnxModel.h.

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

◆ m_output_shape

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

Output tensor shape.

Definition at line 160 of file OnnxModel.h.

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

◆ m_output_type

ONNXTensorElementDataType SourceXtractor::OnnxModel::m_output_type
private

Output type.

Definition at line 158 of file OnnxModel.h.

Referenced by getOutputType(), and OnnxModel().

◆ m_session

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

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

Definition at line 162 of file OnnxModel.h.

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


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