(self, patch)
| 196 | return None, None |
| 197 | |
| 198 | def transform_patch(self, patch): |
| 199 | if random.uniform(0, 1) > self.prob_flip_leftright: |
| 200 | patch = patch.transpose(Image.FLIP_LEFT_RIGHT) |
| 201 | if random.uniform(0, 1) > self.prob_rotate: |
| 202 | patch = patch.rotate(random.randint(-10, 10)) |
| 203 | return patch |
| 204 | |
| 205 | def __call__(self, img): |
| 206 | W, H = img.size # original image size |