facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.21k stars 5.45k forks source link

voc_eval has some bugs? #970

Open CoderGenJ opened 4 years ago

CoderGenJ commented 4 years ago

I find some bugs in this file which is named by Detectron/detectron/datasets/voc_eval.py. From line 213 on:

compute precision recall

fp = np.cumsum(fp)
tp = np.cumsum(tp)
rec = tp / float(npos)
# avoid divide by zero in case the first detection matches a difficult
# ground truth
prec = tp / np.maximum(tp + fp, np.finfo(np.float64).eps)
ap = voc_ap(rec, prec, use_07_metric)

we can see that the rec and prec is not a list but a float number.This means the calculation of ap is not the area of PR curve.

So could you please tell me how to fix or make sense of this question.