(tensor, rgb_range=1.)
| 32 | return rgb |
| 33 | |
| 34 | def tensor2numpy(tensor, rgb_range=1.): |
| 35 | rgb_coefficient = 255 / rgb_range |
| 36 | img = tensor.mul(rgb_coefficient).clamp(0, 255).round() |
| 37 | img = np.transpose(img.cpu().detach().numpy(), (1, 2, 0)).astype(np.uint8) |
| 38 | return img |
| 39 | |
| 40 | def np2Tensor(img, rgb_range=1, n_colors=1): |
| 41 | img = img.astype('float64') |
nothing calls this directly
no outgoing calls
no test coverage detected