(x: torch.Tensor)
| 19 | return 20 * torch.log10(1.0 / torch.sqrt(mse)) |
| 20 | |
| 21 | def easy_cmap(x: torch.Tensor): |
| 22 | x_rgb = torch.zeros((3, x.shape[0], x.shape[1]), dtype=torch.float32, device=x.device) |
| 23 | x_max, x_min = x.max(), x.min() |
| 24 | x_normalize = (x - x_min) / (x_max - x_min) |
| 25 | x_rgb[0] = torch.clamp(x_normalize, 0, 1) |
| 26 | x_rgb[1] = torch.clamp(x_normalize, 0, 1) |
| 27 | x_rgb[2] = torch.clamp(x_normalize, 0, 1) |
| 28 | return x_rgb |
| 29 |