Apply Solarization to the PIL image.
| 48 | return img |
| 49 | |
| 50 | class Solarization(object): |
| 51 | """ |
| 52 | Apply Solarization to the PIL image. |
| 53 | """ |
| 54 | def __init__(self, p=0.2): |
| 55 | self.p = p |
| 56 | |
| 57 | def __call__(self, img): |
| 58 | if random.random() < self.p: |
| 59 | return ImageOps.solarize(img) |
| 60 | else: |
| 61 | return img |
| 62 | |
| 63 | class gray_scale(object): |
| 64 | """ |
no outgoing calls
no test coverage detected