# nms

Python API: `depthai_nodes.node.utils.nms`

## Functions

### nms

```python
def nms(boxes, scores, iou_thresh):
```

Perform Non-Maximum Suppression (NMS).

Parameters

 * `boxes` (`np.ndarray`): An ndarray of shape (N, 4), where each row is [xmin, ymin, xmax, ymax].
 * `scores` (`np.ndarray`): An ndarray of shape (N,), containing the confidence scores for each box.
 * `iou_thresh` (`float`): The IoU threshold for Non-Maximum Suppression (NMS).

Returns

 * `list[int]`: A list of indices of the boxes to keep after applying NMS.

### nms_detections

```python
def nms_detections(detections: list[dai.ImgDetection], conf_thresh=0.3, iou_thresh=0.4):
```

Apply non-maximum suppression independently to each detection class.

Parameters

 * `detections` (`list[dai.ImgDetection]`): Detections with normalized bounding boxes.
 * `conf_thresh` (`float`): Minimum confidence score to retain.
 * `iou_thresh` (`float`): Intersection-over-union threshold for suppression.

Returns

 * `list[dai.ImgDetection]`: * `Detections that pass confidence filtering and`: per-class suppression.
