Denormalize an image array to [0,1].
(images: Union[np.ndarray, torch.Tensor])
| 143 | |
| 144 | @staticmethod |
| 145 | def denormalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]: |
| 146 | """ |
| 147 | Denormalize an image array to [0,1]. |
| 148 | """ |
| 149 | return (images / 2 + 0.5).clamp(0, 1) |
| 150 | |
| 151 | @staticmethod |
| 152 | def convert_to_rgb(image: PIL.Image.Image) -> PIL.Image.Image: |
no outgoing calls
no test coverage detected