18 #include <onnxruntime_cxx_api.h>
32 namespace SourceXtractor {
41 if (!domain.
empty()) {
42 prop_name << domain <<
'.';
46 if (!graph_name.
empty()) {
47 prop_name << graph_name <<
'.';
52 return prop_name.
str();
58 if (property_id == PropertyId::create<OnnxProperty>()) {
70 const auto& models = onnx_config.
getModels();
72 for (
auto model_path : models) {
73 auto model = std::make_shared<OnnxModel>(model_path);
75 if (model->getInputType() != ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT) {
79 if (model->getInputShape().size() != 4) {
80 throw Elements::Exception() <<
"Expected 4 axes for the input layer, got " << model->getInputShape().size();
97 return prop.getData<T>(key);
98 },
"", model_info.
model->getModelPath()
104 switch (model_info.model->getOutputType()) {
105 case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT:
106 registerColumnConverter<float>(registry, model_info);
108 case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
109 registerColumnConverter<int32_t>(registry, model_info);
112 throw Elements::Exception() <<
"Unsupported output type: " << model_info.model->getOutputType();
void info(const std::string &logMessage)
void registerConfiguration()