(tensor)
| 45 | |
| 46 | |
| 47 | def to_image(tensor): |
| 48 | tensor = tensor.squeeze(0).permute(1, 2, 0) |
| 49 | arr = tensor.detach().cpu().numpy() |
| 50 | arr = (arr - arr.min()) / (arr.max() - arr.min()) |
| 51 | arr = arr * 255 |
| 52 | return arr.astype('uint8') |
| 53 | |
| 54 | |
| 55 | def add_points_to_image(image, points, size=5): |
no outgoing calls
no test coverage detected