最后更新
depthai_nodes.node.parsers.utils.nms函数
nms
Python
1def nms(dets: np.ndarray, nms_thresh: float = 0.5) -> list[int]:dets(np.ndarray): 边界框和置信度分数。nms_thresh(float): 非极大值抑制阈值。
list[int]: 要保留的检测索引。
nms_cv2
Python
1def nms_cv2(bboxes: np.ndarray, scores: np.ndarray, conf_threshold: float, iou_threshold: float, max_det: int):bboxes(np.ndarray): 形状为(N, 4)的数组,格式为[x, y, width, height]。scores(np.ndarray): 形状为(N,)的置信度分数。conf_threshold(float): 用于过滤候选的得分阈值。iou_threshold(float): 用于抑制的交并比阈值。max_det(int): OpenCV 考虑的最大候选数。
list[int]:保留框的索引,如果没有候选框,则返回空列表。