Denormalize an image array to [0,1].
(images: Union[np.ndarray, torch.Tensor])
| 156 | |
| 157 | @staticmethod |
| 158 | def denormalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]: |
| 159 | """ |
| 160 | Denormalize an image array to [0,1]. |
| 161 | """ |
| 162 | return (images / 2 + 0.5).clamp(0, 1) |
| 163 | |
| 164 | @staticmethod |
| 165 | def convert_to_rgb(image: PIL.Image.Image) -> PIL.Image.Image: |
no outgoing calls
no test coverage detected