# detection

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

## Functions

| Name | Description |
| --- | --- |
| [`compute_detection_outputs`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/detection.md#detection-Functions-compute_detection_outputs) | Suppress overlapping detections and convert retained boxes. |

### function `compute_detection_outputs`

```python
def compute_detection_outputs(
    bboxes: np.ndarray,
    scores: np.ndarray,
    *,
    conf_threshold: float,
    iou_threshold: float,
    max_det: int,
) -> tuple[np.ndarray, np.ndarray]
```

Suppress overlapping detections and convert retained boxes.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `bboxes` | `np.ndarray` | Bounding boxes of shape `(N, 4)` in `[xmin, ymin, xmax, ymax]` format. | required |
| `scores` | `np.ndarray` | Confidence scores of shape `(N,)`. | required |
| `conf_threshold` | `float` | Minimum detection confidence used to filter candidates. | required |
| `iou_threshold` | `float` | Intersection-over-union threshold for non-maximum suppression. | required |
| `max_det` | `int` | Maximum number of detection candidates to retain or consider during suppression. | required |

Returns

| Type | Description |
| --- | --- |
| `tuple[np.ndarray, np.ndarray]` | Retained center-XY/width/height boxes and corresponding scores. Coordinates retain their input units. Both arrays are empty if no boxes survive. |
