Skip to main content

Nms

Trait Nms 

Source
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§

Source

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) format
  • scores - Confidence scores as [N] tensor
  • options - NMS options (IoU threshold, score threshold, max boxes)
§Returns

Indices of kept boxes as [M] tensor where M <= N

Implementations on Foreign Types§

Source§

impl<B: VisionBackend> Nms<B> for Tensor<B, 2>

Source§

fn nms(self, scores: Tensor<B, 1>, options: NmsOptions) -> Tensor<B, 1, Int>

Implementors§