此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 函数
  • nms
  • nms_detections
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包
最后更新
Python API: depthai_nodes.node.utils.nms

函数

nms

Python
1def nms(boxes, scores, iou_thresh):
执行非极大值抑制 (NMS)。参数
  • boxes (np.ndarray): 形状为 (N, 4) 的 ndarray,其中每一行是 [xmin, ymin, xmax, ymax]。
  • scores (np.ndarray): 形状为 (N,) 的 ndarray,包含每个框的置信度分数。
  • iou_thresh (float): 非极大值抑制 (NMS) 的 IoU 阈值。
返回
  • list[int]: 应用 NMS 后要保留的框的索引列表。

nms_detections

Python
1def nms_detections(detections: list[dai.ImgDetection], conf_thresh=0.3, iou_thresh=0.4):
独立地对每个检测类别应用非极大值抑制。参数
  • detections (list[dai.ImgDetection]): 带有归一化边界框的检测。
  • conf_thresh (float): 要保留的最小置信度分数。
  • iou_thresh (float): 用于抑制的交并比阈值。
返回
  • list[dai.ImgDetection]:
    • 通过置信度过滤和每类抑制的检测。