Args: factor_range (list or tuple): an interval to randomly sample the `contrast_factor`. rgb (bool or None): if None, use the mean per-channel. clip (bool): clip to [0, 255] even when data type is not uint8.
(self, factor_range, rgb=None, clip=True)
| 102 | """ |
| 103 | |
| 104 | def __init__(self, factor_range, rgb=None, clip=True): |
| 105 | """ |
| 106 | Args: |
| 107 | factor_range (list or tuple): an interval to randomly sample the `contrast_factor`. |
| 108 | rgb (bool or None): if None, use the mean per-channel. |
| 109 | clip (bool): clip to [0, 255] even when data type is not uint8. |
| 110 | """ |
| 111 | super(Contrast, self).__init__() |
| 112 | self._init(locals()) |
| 113 | |
| 114 | def _get_augment_params(self, _): |
| 115 | return self._rand_range(*self.factor_range) |