DetectAsync
(
imageJpgOrPng
, ct
)
|
Performs object detection on an encoded image (JPEG/PNG).
Used by cloud providers (e.g., HuggingFace) that accept binary image uploads.
Signature
Task< string > DetectAsync(byte[] imageJpgOrPng, CancellationToken ct=default) Parameters imageJpgOrPng: byte[]Â
Encoded image bytes in JPEG or PNG format.
ct: CancellationTokenÂ
Cancellation token for aborting the operation.
Returns Task< string >Â
JSON string containing detection results with boxes, scores, and labels.
|
DetectAsync
(
src
, ct
)
|
Performs object detection directly on a GPU texture (fastest path).
Used by on-device providers (e.g., UnityInferenceEngine) to avoid CPU-GPU transfers.
Signature
Task< byte[]> DetectAsync(RenderTexture src, CancellationToken ct=default) Parameters src: RenderTextureÂ
Source RenderTexture containing the image to analyze.
ct: CancellationTokenÂ
Cancellation token for aborting the operation.
Returns Task< byte[]>Â
Binary-encoded detection results for efficient downstream processing.
|