SourceXtractorPlusPlus
0.16
Please provide a description of the project.
|
#include <OnnxModel.h>
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::string > | m_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_t > | m_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... | |
Definition at line 21 of file OnnxModel.h.
|
explicit |
Definition at line 32 of file OnnxModel.cpp.
References std::string::c_str(), std::vector< T >::emplace_back(), Elements::Logging::getLogger(), Elements::Logging::info(), m_domain_name, m_graph_name, m_input_names, m_input_shapes, m_input_types, m_model_path, m_output_name, m_output_shape, m_output_type, m_session, SourceXtractor::onnx_logger, and SourceXtractor::ORT_ENV.
|
inline |
Definition at line 108 of file OnnxModel.h.
References m_domain_name.
Referenced by SourceXtractor::generatePropertyName().
|
inline |
Definition at line 112 of file OnnxModel.h.
References m_graph_name.
Referenced by SourceXtractor::generatePropertyName().
|
inline |
Definition at line 116 of file OnnxModel.h.
References m_input_names.
|
inline |
Definition at line 128 of file OnnxModel.h.
References m_input_names, and std::vector< T >::size().
Referenced by SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 100 of file OnnxModel.h.
References m_input_shapes.
Referenced by SourceXtractor::computePropertiesSpecialized(), ModelFitting::OnnxCompactModel< ImageType >::getRasterizedImage(), and SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 92 of file OnnxModel.h.
References m_input_types.
Referenced by SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 124 of file OnnxModel.h.
References m_model_path.
|
inline |
Definition at line 120 of file OnnxModel.h.
References m_output_name.
Referenced by SourceXtractor::generatePropertyName().
|
inline |
Definition at line 132 of file OnnxModel.h.
|
inline |
Definition at line 104 of file OnnxModel.h.
References m_output_shape.
Referenced by SourceXtractor::computePropertiesSpecialized(), ModelFitting::OnnxCompactModel< ImageType >::getRasterizedImage(), and SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 96 of file OnnxModel.h.
References m_output_type.
Referenced by ModelFitting::OnnxCompactModel< ImageType >::getRasterizedImage(), and SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 27 of file OnnxModel.h.
References std::accumulate(), std::vector< T >::begin(), std::begin(), std::string::c_str(), std::vector< T >::data(), std::vector< T >::end(), std::end(), m_input_names, m_input_shapes, m_output_name, m_output_shape, m_session, and std::vector< T >::size().
Referenced by SourceXtractor::computePropertiesSpecialized(), and SourceXtractor::MLSegmentation::labelImage().
|
inline |
Definition at line 56 of file OnnxModel.h.
References std::accumulate(), std::vector< T >::begin(), std::begin(), std::string::c_str(), std::vector< T >::data(), std::vector< T >::emplace_back(), std::vector< T >::end(), std::end(), m_input_names, m_input_shapes, m_output_name, m_output_shape, m_session, and std::vector< T >::size().
Referenced by ModelFitting::OnnxCompactModel< ImageType >::getRasterizedImage().
|
private |
|
private |
graph name
Definition at line 138 of file OnnxModel.h.
Referenced by getGraphName(), and OnnxModel().
|
private |
Input tensor name.
Definition at line 139 of file OnnxModel.h.
Referenced by getInputName(), getInputNb(), OnnxModel(), run(), and runMultiInput().
|
private |
Input tensor shape.
Definition at line 143 of file OnnxModel.h.
Referenced by getInputShape(), OnnxModel(), run(), and runMultiInput().
|
private |
Input type.
Definition at line 141 of file OnnxModel.h.
Referenced by getInputType(), and OnnxModel().
|
private |
Path to the ONNX model.
Definition at line 145 of file OnnxModel.h.
Referenced by getModelPath(), and OnnxModel().
|
private |
Output tensor name.
Definition at line 140 of file OnnxModel.h.
Referenced by getOutputName(), OnnxModel(), run(), and runMultiInput().
|
private |
Output tensor shape.
Definition at line 144 of file OnnxModel.h.
Referenced by getOutputShape(), OnnxModel(), run(), and runMultiInput().
|
private |
Output type.
Definition at line 142 of file OnnxModel.h.
Referenced by getOutputType(), and OnnxModel().
|
private |
Session, one per model. In theory, it is thread-safe.
Definition at line 146 of file OnnxModel.h.
Referenced by OnnxModel(), run(), and runMultiInput().