From 7753a965b4fdca748dea67681d5e455bc32e44c8 Mon Sep 17 00:00:00 2001 From: adityap27 Date: Mon, 6 Jul 2020 22:14:30 +0530 Subject: [PATCH] fixed mAP calculation for points=0 --- src/detector.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/detector.c b/src/detector.c index 6c181021..28bd712f 100644 --- a/src/detector.c +++ b/src/detector.c @@ -1253,6 +1253,12 @@ float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, floa avg_precision += delta_recall * last_precision; } + //add remaining area of PR curve when recall isn't 0 at rank-1 + if(pr[i][0].recall!=0) + { + //no need of delta_recall=last_recall-0; + avg_precision += last_recall * last_precision; + } } // MSCOCO - 101 Recall-points, PascalVOC - 11 Recall-points else