pub trait Nms<B: Backend> {
// Required method
fn nms(
self,
scores: Tensor<B, 1, Float>,
opts: NmsOptions,
) -> Tensor<B, 1, Int>;
}Expand description
Non-maximum suppression tensor operations
Required Methods§
Sourcefn nms(self, scores: Tensor<B, 1, Float>, opts: NmsOptions) -> Tensor<B, 1, Int>
fn nms(self, scores: Tensor<B, 1, Float>, opts: NmsOptions) -> Tensor<B, 1, Int>
Perform Non-Maximum Suppression on this tensor of bounding boxes.
Returns indices of kept boxes after suppressing overlapping detections. Boxes are processed in descending score order; a box suppresses all lower-scoring boxes with IoU > threshold.
§Arguments
self- Bounding boxes as [N, 4] tensor in (x1, y1, x2, y2) formatscores- Confidence scores as [N] tensoroptions- NMS options (IoU threshold, score threshold, max boxes)
§Returns
Indices of kept boxes as [M] tensor where M <= N