# nms

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

## Functions

### nms

```python
def nms(dets: np.ndarray, nms_thresh: float = 0.5) -> list[int]:
```

Non-maximum suppression.

Parameters

 * `dets` (`np.ndarray`): Bounding boxes and confidence scores.
 * `nms_thresh` (`float`): Non-maximum suppression threshold.

Returns

 * `list[int]`: Indices of the detections to keep.

### nms_cv2

```python
def nms_cv2(bboxes: np.ndarray, scores: np.ndarray, conf_threshold: float, iou_threshold: float, max_det: int):
```

Apply OpenCV non-maximum suppression to bounding boxes.

Parameters

 * `bboxes` (`np.ndarray`): Array of shape `(N, 4)` in `[x, y, width, height]` format.
 * `scores` (`np.ndarray`): Confidence scores of shape `(N,)`.
 * `conf_threshold` (`float`): Score threshold for filtering candidates.
 * `iou_threshold` (`float`): Intersection-over-union threshold for suppression.
 * `max_det` (`int`): Maximum number of candidates considered by OpenCV.

Returns

 * `list[int]`: * `Indices of the retained boxes, or an empty list when there are no`: candidates.
