mmagic.datasets.transforms.normalization
¶
Module Contents¶
Classes¶
Normalize images with the given mean and std value. |
|
Transform the images into a range between 0 and 1. |
- class mmagic.datasets.transforms.normalization.Normalize(keys, mean, std, to_rgb=False, save_original=False)[source]¶
Bases:
mmcv.transforms.BaseTransform
Normalize images with the given mean and std value.
Required keys are the keys in attribute “keys”, added or modified keys are the keys in attribute “keys” and these keys with postfix ‘_norm_cfg’. It also supports normalizing a list of images.
- Parameters
keys (Sequence[str]) – The images to be normalized.
mean (np.ndarray) – Mean values of different channels.
std (np.ndarray) – Std values of different channels.
to_rgb (bool) – Whether to convert channels from BGR to RGB. Default: False.
save_original (bool) – Whether to save original images. Default: False.
- class mmagic.datasets.transforms.normalization.RescaleToZeroOne(keys)[source]¶
Bases:
mmcv.transforms.BaseTransform
Transform the images into a range between 0 and 1.
Required keys are the keys in attribute “keys”, added or modified keys are the keys in attribute “keys”. It also supports rescaling a list of images.
- Parameters
keys (Sequence[str]) – The images to be transformed.