Apply Solarization to the PIL image.
| 41 | return img |
| 42 | |
| 43 | class Solarization(object): |
| 44 | """ |
| 45 | Apply Solarization to the PIL image. |
| 46 | """ |
| 47 | def __init__(self, p=0.2): |
| 48 | self.p = p |
| 49 | |
| 50 | def __call__(self, img): |
| 51 | if random.random() < self.p: |
| 52 | return ImageOps.solarize(img) |
| 53 | else: |
| 54 | return img |
| 55 | |
| 56 | class gray_scale(object): |
| 57 | """ |
no outgoing calls
no test coverage detected