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
Inference #
DeepLab image inference
method : public : Inference(image:Byte[], labels:String[]) ~ API.Onnx.DeepLabResultParameters
| Name | Type | Description |
|---|---|---|
| image | Byte | image bytes |
| labels | String | classification 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();