DefaultSupportedTypes
: override InferenceType
[Get] |
Indicates that this provider supports only InferenceType.OnDevice execution, meaning all inference runs locally on the headset (using Unity Inference Engine backends).
Signature
override InferenceType DefaultSupportedTypes |
SupportsVision
: bool
[Get] |
Signature
bool SupportsVision |
ChatAsync
(
req
, stream
, ct
)
|
Performs on-device text-only LLM chat inference using Unity Inference Engine.
Supports streaming token generation with proven approach from SmolLM, Qwen, and Phi models.
Signature
async Task< ChatResponse > ChatAsync(ChatRequest req, IProgress< ChatDelta > stream=null, CancellationToken ct=default) Parameters ct: CancellationTokenÂ
Cancellation token to abort inference.
|
DetectAsync
(
src
, ct
)
|
Performs object detection on any Texture input (e.g., Texture2D or RenderTexture) using the Unity Inference Engine.
The model runs entirely on-device, producing bounding boxes, scores, and class IDs, which are filtered via GPU-based Non-Maximum Suppression (NMS) and returned as a compact binary result.
Signature
async Task< byte[]> DetectAsync(Texture src, CancellationToken ct=default) Parameters src: TextureÂ
The source Texture to process. Must be readable on GPU.
ct: CancellationTokenÂ
Optional CancellationToken to abort inference if needed.
Returns async Task< byte[]>Â
A binary-encoded byte array containing filtered detections in the format: [count][x,y,w,h,score,classId,label] per detection.
|
DetectAsync
(
src
, ct
)
|
Overload of DetectAsync(Texture, CancellationToken) that accepts a RenderTexture.
This avoids an unnecessary GPU blit by forwarding the call to the Texture overload directly.
Signature
async Task< byte[]> DetectAsync(RenderTexture src, CancellationToken ct=default) Parameters src: RenderTextureÂ
Source RenderTexture to analyze.
ct: CancellationTokenÂ
Optional CancellationToken to abort the operation.
Returns async Task< byte[]>Â
A binary-encoded byte array containing filtered detection results: [count][x,y,w,h,score,classId,label] per detection.
|
DetectAsync
(
imageJpgOrPng
, ct
)
|
(Not yet implemented) Performs object detection on a raw image byte array (JPG or PNG format) and returns results as a JSON string.
Intended for CPU-based or cloud provider implementations.
Signature
Task< string > DetectAsync(byte[] imageJpgOrPng, CancellationToken ct=default) Parameters imageJpgOrPng: byte[]ct: CancellationTokenReturns Task< string > |