From 002b99737ce8558f6183e3561e4f61a43d3a5600 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Thu, 23 Sep 2021 11:30:24 +0900 Subject: [PATCH] More pythonic way to find aind and mind for _summarize function More pythonic way to find aind and mind for _summarize function --- PythonAPI/pycocotools/cocoeval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PythonAPI/pycocotools/cocoeval.py b/PythonAPI/pycocotools/cocoeval.py index f4e3decb..485b34ef 100644 --- a/PythonAPI/pycocotools/cocoeval.py +++ b/PythonAPI/pycocotools/cocoeval.py @@ -432,8 +432,8 @@ def _summarize( ap=1, iouThr=None, areaRng='all', maxDets=100 ): iouStr = '{:0.2f}:{:0.2f}'.format(p.iouThrs[0], p.iouThrs[-1]) \ if iouThr is None else '{:0.2f}'.format(iouThr) - aind = [i for i, aRng in enumerate(p.areaRngLbl) if aRng == areaRng] - mind = [i for i, mDet in enumerate(p.maxDets) if mDet == maxDets] + aind = p.areaRngLbl.index(areaRng) + mind = p.maxDets.index(maxDets) if ap == 1: # dimension of precision: [TxRxKxAxM] s = self.eval['precision']