Bundle
ONNX Runtime inference library for running pre-trained models. Supports object detection (YOLO), image classification (ResNet), segmentation (DeepLab), pose estimation (OpenPose), face recognition, and Phi-3 text generation. Compile with -lib onnx.
ModelInfo
What a model takes in and gives back. Worth reading once before building inputs. The alternative is guessing at names and shapes, and a mismatch is reported by the runtime in terms of the graph rather than of anything the caller wrote.
Example
session := Session->New("model.onnx");
info := session->GetModelInfo();
each(spec in info->GetInputs()) {
spec->ToString()->PrintLine();
};Operations
Find #
One input or output by name, whichever side it is on.
method : public : Find(name:String) ~ TensorSpecParameters
| Name | Type | Description |
|---|---|---|
| name | String | the tensor name |
Return
| Type | Description |
|---|---|
| TensorSpec | the specification, or Nil when the model has no such tensor |
GetInputNames #
Input names, for a run that names a subset.
method : public : GetInputNames() ~ String[]Return
| Type | Description |
|---|---|
| String | input names |
GetInputs #
The model's inputs, in the order the graph declares them.
method : public : GetInputs() ~ Vector<TensorSpec>Return
| Type | Description |
|---|---|
| Vector<TensorSpec> | input specifications |