| 22 | |
| 23 | |
| 24 | class RandomHue(Augmentation): |
| 25 | |
| 26 | def __init__(self, format, fraction=0.5, prob=0.5): |
| 27 | super().__init__() |
| 28 | self._init(locals()) |
| 29 | |
| 30 | def get_transform(self, img): |
| 31 | do = self._rand_range() < self.prob |
| 32 | if do: |
| 33 | S_rand, V_rand = random.random(), random.random() |
| 34 | return HueTransform(self.fraction, S_rand, V_rand, self.format) |
| 35 | else: |
| 36 | return NoOpTransform() |
| 37 | |
| 38 | class LetterBox(Augmentation): |
| 39 |
no outgoing calls
no test coverage detected