v2026.5.3
All Bundles
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.

DeepLabSession

DeepLab inference session for semantic segmentation. Auto-detects model input dimensions and supports both NCHW and NHWC layouts. Returns per-class coverage percentages and polygon boundaries. Example labels := ["background", "person", "bicycle", "car"]; session := DeepLabSession->New("deeplabv3.onnx"); result := session->Inference(image_bytes, labels); each(cls in result->GetClassifications()) { "{cls->GetName()}: {cls->GetConfidence()}%"->PrintLine(); }; session->Close();

Operations

Close #

Closes the session

method : public : Close() ~ Nil

Inference #

DeepLab image inference

method : public : Inference(image:Byte[], labels:String[]) ~ API.Onnx.DeepLabResult

Parameters

NameTypeDescription
imageByteimage bytes
labelsStringclassification labels

Example

labels := ["background", "person", "car"];
session := DeepLabSession->New("deeplabv3.onnx");
image := FileReader->ReadBinaryFile("scene.jpg");
result := session->Inference(image, labels);
each(cls in result->GetClassifications()) {
  "{$cls->GetName()}: {$cls->GetConfidence()}%"->PrintLine();
};
session->Close();

New # constructor

Constructor.

New(model:String)

Parameters

NameTypeDescription
modelStringDeepLab model path

New # constructor

Constructor.

New(model:String, config:Map<String,String>)

Parameters

NameTypeDescription
modelStringDeepLab model path
configMap<String,String>session configuration parameters