微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Yolov3 中确定正确的置信度

如何解决在 Yolov3 中确定正确的置信度

我使用的是遵循 opencv tutorial 的预训练 yolo 模型。根据yolo算法,检测数组的前五个包含置信度,x,y,w,h。其余的是班级数。

for output in outputs:
    for detection in output:
        scores = detection[5:]
        classID = np.argmax(scores)
        confidence = scores[classID]
        if confidence > 0.5:
            Box = detection[:4] * np.array([w,h,w,h])
            (centerX,centerY,width,height) = Box.astype("int")
            x = int(centerX - (width / 2))
            y = int(centerY - (height / 2))
            Box = [x,y,int(width),int(height)]
            Boxes.append(Box)
            confidences.append(float(confidence))
            classIDs.append(classID)

因此,scores[classID] 必须包含成为该类别的概率。相反,它被用作置信度。同样检测[5]也没有在任何地方使用。检测 [5] 是否包含置信度?由于在大多数情况下使用预测类并跳过置信度不会产生太大影响,因此似乎跳过了置信度分数。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。