yolo3-pytorch icon indicating copy to clipboard operation
yolo3-pytorch copied to clipboard

about utils

Open Jiangyangya opened this issue 2 years ago • 2 comments

你好,我想请问一下在utils的non_max_suppression计算中用的是自带nms,我修改后用您下面注释的部分去使用其他iou作为阈值时,为啥对map等评价指标几乎没有影响? Uploading pic20210906023400.png…

Jiangyangya avatar Sep 06 '21 02:09 Jiangyangya

        # 按照存在物体的置信度排序
        _, conf_sort_index = torch.sort(detections_class[:, 4]*detections_class[:, 5], descending=True)
        detections_class = detections_class[conf_sort_index]
        # 进行非极大抑制
        max_detections = []
        while detections_class.size(0):
            # 取出这一类置信度最高的,一步一步往下判断,判断重合程度是否大于nms_thres,如果是则去除掉
            max_detections.append(detections_class[0].unsqueeze(0))
            if len(detections_class) == 1:
                break
            ious = bbox_iou(max_detections[-1], detections_class[1:])
            detections_class = detections_class[1:][ious < nms_thres]
        # 堆叠
        max_detections = torch.cat(max_detections).data

Jiangyangya avatar Sep 06 '21 02:09 Jiangyangya

你说的是你自己修改了吗,还是我原来的,我原来的就是普通的nms

bubbliiiing avatar Sep 07 '21 14:09 bubbliiiing