MCPcopy Create free account
hub / github.com/NarcissusEx/GuardSplat / RotationAttack

Class RotationAttack

attack_utils.py:84–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 return cropped_img
83
84class 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
94class ResizeAttack(nn.Module):
95 def __init__(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected