ONNX-Runtime-Inference
ONNX-Runtime-Inference copied to clipboard
multiple input
Hello, my question is, what if your input is not an image but for example more than one sensor data. how do perform inference wen you already have your onnx file? thank you
I think this may help you:
` std::vectorOrt::Value inputTensors;
std::vector<std::vector
for (int i = 0; i < numInputs; ++i) {
inputNames.push_back(session.GetInputName(i, allocator));
std::vector<int64_t> inputDimsI = session.GetInputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape();
int inputTensorSize = vectorProduct(inputDimsI);
inputDims.push_back(inputTensorSize);
std::vector<float> inputTensorValues(inputTensorSize);
inputTensorsValues.push_back(inputTensorValues);
inputTensors.push_back(Ort::Value::CreateTensor<float>(
memoryInfo, inputTensorsValues[i].data(), inputTensorSize,
inputDimsI.data(), inputDimsI.size()));
}`