| 83 | |
| 84 | @register_to_config |
| 85 | def __init__( |
| 86 | self, |
| 87 | do_resize: bool = True, |
| 88 | vae_scale_factor: int = 8, |
| 89 | resample: str = "lanczos", |
| 90 | do_normalize: bool = True, |
| 91 | do_binarize: bool = False, |
| 92 | do_convert_rgb: bool = False, |
| 93 | do_convert_grayscale: bool = False, |
| 94 | ): |
| 95 | super().__init__() |
| 96 | if do_convert_rgb and do_convert_grayscale: |
| 97 | raise ValueError( |
| 98 | "`do_convert_rgb` and `do_convert_grayscale` can not both be set to `True`," |
| 99 | " if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`.", |
| 100 | " if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`", |
| 101 | ) |
| 102 | |
| 103 | @staticmethod |
| 104 | def numpy_to_pil(images: np.ndarray) -> List[PIL.Image.Image]: |