dhkim2810 commited on
Commit
7800342
1 Parent(s): 14b4453

Fix indexing error

Browse files
Files changed (1) hide show
  1. utils/tools.py +2 -2
utils/tools.py CHANGED
@@ -398,9 +398,9 @@ def point_prompt(masks, points, point_label, target_height, target_width): # nu
398
  else:
399
  mask = annotation
400
  for i, point in enumerate(points):
401
- if mask[point[0], point[1]] == 1 and point_label[i] == 1:
402
  onemask += mask
403
- if mask[point[0], point[1]] == 1 and point_label[i] == 0:
404
  onemask -= mask
405
  onemask = onemask >= 1
406
  return onemask, 0
 
398
  else:
399
  mask = annotation
400
  for i, point in enumerate(points):
401
+ if mask[point[1], point[0]] == 1 and point_label[i] == 1:
402
  onemask += mask
403
+ if mask[point[1], point[0]] == 1 and point_label[i] == 0:
404
  onemask -= mask
405
  onemask = onemask >= 1
406
  return onemask, 0