MCPcopy Create free account
hub / github.com/Chen-Yang-Liu/Text2Earth / denormalize

Method denormalize

src/diffusers/image_processor.py:158–162  ·  view source on GitHub ↗

Denormalize an image array to [0,1].

(images: Union[np.ndarray, torch.Tensor])

Source from the content-addressed store, hash-verified

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:

Callers 2

postprocessMethod · 0.95
postprocessMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected