(multi_rater)
| 439 | |
| 440 | |
| 441 | def random_box(multi_rater): |
| 442 | max_value = torch.max(multi_rater[:,0,:,:], dim=0)[0] |
| 443 | max_value_position = torch.nonzero(max_value) |
| 444 | |
| 445 | x_coords = max_value_position[:, 0] |
| 446 | y_coords = max_value_position[:, 1] |
| 447 | |
| 448 | |
| 449 | x_min = int(torch.min(x_coords)) |
| 450 | x_max = int(torch.max(x_coords)) |
| 451 | y_min = int(torch.min(y_coords)) |
| 452 | y_max = int(torch.max(y_coords)) |
| 453 | |
| 454 | |
| 455 | x_min = random.choice(np.arange(x_min-10,x_min+11)) |
| 456 | x_max = random.choice(np.arange(x_max-10,x_max+11)) |
| 457 | y_min = random.choice(np.arange(y_min-10,y_min+11)) |
| 458 | y_max = random.choice(np.arange(y_max-10,y_max+11)) |
| 459 | |
| 460 | return x_min, x_max, y_min, y_max |
| 461 | |
| 462 |
nothing calls this directly
no outgoing calls
no test coverage detected