Class Acts::OnnxRuntimeBase

class OnnxRuntimeBase

Subclassed by Acts::MLTrackClassifier

Public Functions

OnnxRuntimeBase() = default

Default constructor.

OnnxRuntimeBase(Ort::Env &env, const char *modelPath)

Parametrized constructor.

Parameters
  • env – the ONNX runtime environment

  • modelPath – the path to the ML model in *.onnx format

~OnnxRuntimeBase() = default

Default destructor.

std::vector<float> runONNXInference(std::vector<float> &inputTensorValues) const

Run the ONNX inference function.

Parameters

inputTensorValues – The input feature values used for prediction

Returns

The output (predicted) values

std::vector<std::vector<float>> runONNXInference(NetworkBatchInput &inputTensorValues) const

Run the ONNX inference function for a batch of input.

Parameters

inputTensorValues – Vector of the input feature values of all the inputs used for prediction

Returns

The vector of output (predicted) values