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

本页目录

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

Functions

compute_detection_outputs

Python
1def 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/宽度/高度框和相应的分数。坐标保留其输入单位。如果没有框保留,则两个数组都为空。