(mask, point_label = 1)
| 423 | |
| 424 | |
| 425 | def random_click(mask, point_label = 1): |
| 426 | max_label = max(set(mask.flatten())) |
| 427 | if round(max_label) == 0: |
| 428 | point_label = round(max_label) |
| 429 | indices = np.argwhere(mask == max_label) |
| 430 | return point_label, indices[np.random.randint(len(indices))] |
| 431 | |
| 432 | def agree_click(mask, label = 1): |
| 433 | # max agreement position |