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