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

Method normalize

src/diffusers/image_processor.py:151–155  ·  view source on GitHub ↗

Normalize an image array to [-1,1].

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

Source from the content-addressed store, hash-verified

149
150 @staticmethod
151 def normalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:
152 """
153 Normalize an image array to [-1,1].
154 """
155 return 2.0 * images - 1.0
156
157 @staticmethod
158 def denormalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:

Callers 4

preprocessMethod · 0.95
preprocessMethod · 0.45

Calls

no outgoing calls