基本概念

P-R曲线
- P为图中precision,即精准度
- R为图中recall,即召回率。
Example
首先用训练好的模型得到所有测试样本的confidence score,每一类(如car)的confidence score保存到一个文件中,如comp1_cls_test_car.txt。假设共有20个测试样本,每个id,confidence score和ground truth label如下:
ground truth label通过预测的bbox与ground truth的iou确定为正样本或负样本

接下来对confidence score排序,得到:

P-R曲线
我们得到top-5的结果,前score最高的5个样本,预测为label为1

此例中采用top-5评估,也可采用其他评估,如AP50,即当预测性与真实性的IoU值大于这个阈值时,该预测框才被认定为真阳性(True Positive,TP),反之就是假阳性(False Positive FP)
在上图中
True Positive:2,4 图片
False Positive:13,19,6图片
接下来
confidence、score排在top-5之外的元素为false negatives和true negatives

其中
False Negatives:9,16,7,20
True Negatives:1,18,5,15,10,17,12,14,8,11,3
在看一遍这个图片

precision=TP/(TP+FP)(真阳)/(真阳+假阳)- 2/5=40%
recall=TP/P(真阳/label中car数量)