Skip to content

Commit

Permalink
fix division by zero bug when calc iou
Browse files Browse the repository at this point in the history
  • Loading branch information
ychfan committed Jul 19, 2019
1 parent a5c1f86 commit fc8ec1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PythonAPI/pycocotools/ytvoseval.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def iou_seq(d_seq, g_seq):
u += maskUtils.area(g)
elif d and not g:
u += maskUtils.area(d)
return i / u
iou = i / u if u > .0 else .0
return iou
ious = np.zeros([len(d), len(g)])
for i, j in np.ndindex(ious.shape):
ious[i, j] = iou_seq(d[i], g[j])
Expand Down

0 comments on commit fc8ec1d

Please sign in to comment.