Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PythonAPI/pycocotools/cocoeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines -435 to +436
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That has different semantics though: your code only gives the first match and throws ValueError when nothing matches, whereas the original list allowed for multiple matches and may return an empty list.

if ap == 1:
# dimension of precision: [TxRxKxAxM]
s = self.eval['precision']
Expand Down