d-1-nms

纯净搜索 为您找到 本页 4 条,用时 0 秒(数据源:360)

AI 回答 由 glm-4-flash 生成 · 仅供参考,请自行核实
1. d-1-NMS(Distance-based Non-Maximum Suppression)是一种基于距离的非极大值抑制算法。
2. 它在目标检测中用于去除重叠的边界框(bounding boxes)。
3. 工作原理:
· 计算每个边界框与其它边界框之间的距离。
· 保留距离最小的边界框,抑制距离较大的边界框。
4. 代码示例(Python):

def d_1_nms(boxes, iou_threshold):
sorted_boxes = sorted(boxes, key=lambda x: x[2]) # 按面积排序
selected_boxes = []
for box in sorted_boxes:
if not selected_boxes:
selected_boxes.append(box)
continue
ious = [iou(box, b) for b in selected_boxes]
if all(i < iou_threshold for i in ious):
selected_boxes.append(box)
return selected_boxes