Apply Solarization to the PIL image.
| 77 | |
| 78 | |
| 79 | class horizontal_flip(object): |
| 80 | """ |
| 81 | Apply Solarization to the PIL image. |
| 82 | """ |
| 83 | def __init__(self, p=0.2,activate_pred=False): |
| 84 | self.p = p |
| 85 | self.transf = transforms.RandomHorizontalFlip(p=1.0) |
| 86 | |
| 87 | def __call__(self, img): |
| 88 | if random.random() < self.p: |
| 89 | return self.transf(img) |
| 90 | else: |
| 91 | return img |
| 92 | |
| 93 | |
| 94 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…