Args: alpha(float): maximum saturation change. rgb (bool): whether input is RGB or BGR. clip (bool): clip results to [0,255] even when data type is not uint8.
(self, alpha=0.4, rgb=True, clip=True)
| 242 | """ |
| 243 | |
| 244 | def __init__(self, alpha=0.4, rgb=True, clip=True): |
| 245 | """ |
| 246 | Args: |
| 247 | alpha(float): maximum saturation change. |
| 248 | rgb (bool): whether input is RGB or BGR. |
| 249 | clip (bool): clip results to [0,255] even when data type is not uint8. |
| 250 | """ |
| 251 | super().__init__() |
| 252 | rgb = bool(rgb) |
| 253 | assert alpha < 1 |
| 254 | self._init(locals()) |
| 255 | |
| 256 | def _get_augment_params(self, _): |
| 257 | return 1 + self._rand_range(-self.alpha, self.alpha) |