(image, label, edge)
| 53 | return image.crop(random_region), label.crop(random_region) |
| 54 | |
| 55 | def randomRotation(image, label, edge): |
| 56 | mode = Image.BICUBIC |
| 57 | if random.random() > 0.8: |
| 58 | random_angle = np.random.randint(-15, 15) |
| 59 | image = image.rotate(random_angle, mode) |
| 60 | label = label.rotate(random_angle, mode) |
| 61 | edge = edge.rotate(random_angle, mode) |
| 62 | return image, label, edge |
| 63 | |
| 64 | def randomRotation_noEdge(image, label): |
| 65 | mode = Image.BICUBIC |
no outgoing calls
no test coverage detected