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

Method normalize

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

131
132 @staticmethod
133 def normalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:
134 """
135 Normalize an image array to [-1,1].
136 """
137 return 2.0 * images - 1.0
138
139 @staticmethod
140 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
spherical_dist_lossFunction · 0.45
cond_fnMethod · 0.45
spherical_dist_lossFunction · 0.45
cond_fnMethod · 0.45

Calls

no outgoing calls