MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / denormalize

Method denormalize

src/diffusers/image_processor.py:140–144  ·  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

138
139 @staticmethod
140 def denormalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:
141 """
142 Denormalize an image array to [0,1].
143 """
144 return (images / 2 + 0.5).clamp(0, 1)
145
146 @staticmethod
147 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