# detection

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

## Functions

### 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]:
```

抑制重叠检测并转换保留的框。

参数

 * `bboxes` (`np.ndarray`): 形状为 `(N, 4)` 的边界框，格式为 `[xmin, ymin, xmax, ymax]`。
 * `scores` (`np.ndarray`): 形状为 `(N,)` 的置信度分数。
 * `conf_threshold` (`float`): 用于过滤候选检测的最小置信度。
 * `iou_threshold` (`float`): 用于非极大值抑制的交并比阈值。
 * `max_det` (`int`): 在抑制过程中保留或考虑的最大检测候选数量。

返回

 * `tuple[np.ndarray, np.ndarray]`: 保留的中心-XY/宽度/高度框和相应的分数。坐标保留其输入单位。如果没有框保留，则两个数组都为空。
