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

Class Attacker

attack_utils.py:127–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 self.model = bmshj2018_factorized(quality=3, pretrained=True).eval().cuda()
126
127class Attacker(nn.Module):
128 def __init__(self, attack_types, flag=True):
129 super().__init__()
130 for attack_type in filter(lambda x : x != 'JPEGCompress', attack_types):
131 setattr(self, attack_type, globals()[f'{attack_type}Attack']())
132
133 if 'JPEGCompress' in attack_types:
134 self.JPEGCompress = JPEGCompressAttack(flag)
135
136 def forward(self, image, attack_type):
137 return getattr(self, attack_type)(image)

Callers 2

trainFunction · 0.90
evalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected