Spaces:
Runtime error
Runtime error
Fix indexing error
Browse files- 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[
|
402 |
onemask += mask
|
403 |
-
if mask[point[
|
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[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
|