最后更新
depthai_nodes.node.utils.nms函数
nms
Python
1def nms(boxes, scores, iou_thresh):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]:- 通过置信度过滤和每类抑制的检测。