GpuNms
(
shader
)
|
Signature
GpuNms(ComputeShader shader) Parameters shader: ComputeShader |
RunNmsAsync
(
boxesBuffer
, scoresBuffer
, classIdsBuffer
, count
, iouThreshold
, minConfidence
, maxKeep
, scaleX
, scaleY
)
|
Zero-copy GPU gather: runs NMS and writes compact detections directly on the GPU, then reads back only the first maxKeep results.
Use when model outputs are on the GPU (Compute backend).
Signature
Task< List< DetectionDto > > RunNmsAsync(ComputeBuffer boxesBuffer, ComputeBuffer scoresBuffer, ComputeBuffer classIdsBuffer, int count, float iouThreshold, float minConfidence, int maxKeep, float scaleX, float scaleY) Parameters boxesBuffer: ComputeBufferÂ
GPU buffer of float4 boxes (xywh).
scoresBuffer: ComputeBufferÂ
GPU buffer of scores.
classIdsBuffer: ComputeBufferÂ
GPU buffer of class IDs.
count: intÂ
Number of candidate boxes.
iouThreshold: floatÂ
IoU overlap threshold for suppression.
minConfidence: floatÂ
Minimum score to consider a box.
maxKeep: intÂ
Maximum number of kept detections.
scaleX: floatÂ
Scale from model input width to source texture width.
scaleY: floatÂ
Scale from model input height to source texture height.
Returns Task< List< DetectionDto > > |
RunNmsIndicesAsync
(
boxes
, scores
, classIds
, iouThreshold
, minConf
, maxKeep
)
|
Runs NMS on the GPU and returns kept indices for the provided CPU lists of boxes and scores.
Use when detection results are already on the CPU. See also RunNmsAsync(UnityEngine.ComputeBuffer,UnityEngine.ComputeBuffer,UnityEngine.ComputeBuffer,int,float,float,int,float,float) for the zero-copy GPU gather path.
Signature
Task< List< int > > RunNmsIndicesAsync(List< Vector4 > boxes, List< float > scores, List< int > classIds, float iouThreshold=0.5f, float minConf=0.5f, int maxKeep=100) Parameters boxes: List< Vector4 >scores: List< float >classIds: List< int >iouThreshold: floatminConf: floatmaxKeep: intReturns Task< List< int > > |
UnityInferenceEngineProvider). Scores are unitless confidences in [0,1] and are suitable for thresholding or UI display.
Box
: Vector4 |
Axis-aligned rectangle in source texture space as (x, y, w, h).
The provider applies scaling from model input dimensions so consumers can directly overlay this on the original frame without additional normalization or aspect-ratio math.
Signature
Vector4 Box |
ID
: int |
Zero-based class index emitted by the model for this detection.
Resolve to a descriptive label using the same labels table that was used at inference time to ensure consistent categories.
Signature
int ID |
Score
: float |
Confidence score in the [0,1] range reflecting the model’s belief that this box contains the predicted class.
Use this to sort, filter, or annotate UI elements with a percentage value.
Signature
float Score |