| 82 | return cropped_img |
| 83 | |
| 84 | class RotationAttack(nn.Module): |
| 85 | def __init__(self): |
| 86 | super().__init__() |
| 87 | self.angle = 30 |
| 88 | |
| 89 | def forward(self, image): |
| 90 | rand_num = random.uniform(-1, 1) |
| 91 | rotated_img = F.rotate(image, self.angle * rand_num)#, expand = True) |
| 92 | return rotated_img |
| 93 | |
| 94 | class ResizeAttack(nn.Module): |
| 95 | def __init__(self): |
nothing calls this directly
no outgoing calls
no test coverage detected