MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / normalize

Method normalize

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

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

Callers 15

preprocessMethod · 0.95
preprocessMethod · 0.45
transformMethod · 0.45
transformMethod · 0.45
transformMethod · 0.45
transformMethod · 0.45
to_latentFunction · 0.45
spherical_dist_lossFunction · 0.45
cond_fnMethod · 0.45
spherical_dist_lossFunction · 0.45

Calls

no outgoing calls