浏览代码

Fix for AP calculation limits 0.0 - 1.0 (#4563)

This PR brings alignment in AP computation practices with Detectron2 and MMDetection. 

Problem first noted by @yusiyoh in https://github.com/ultralytics/yolov5/issues/4546
modifyDataloader
Glenn Jocher GitHub 3 年前
父节点
当前提交
8ac96b7975
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      utils/metrics.py

+ 2
- 2
utils/metrics.py 查看文件

@@ -91,8 +91,8 @@ def compute_ap(recall, precision):
"""

# Append sentinel values to beginning and end
mrec = np.concatenate(([0.], recall, [recall[-1] + 0.01]))
mpre = np.concatenate(([1.], precision, [0.]))
mrec = np.concatenate(([0.0], recall, [1.0]))
mpre = np.concatenate(([1.0], precision, [0.0]))

# Compute the precision envelope
mpre = np.flip(np.maximum.accumulate(np.flip(mpre)))

正在加载...
取消
保存