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

Function load_decoder_and_message

wm_utils.py:142–149  ·  view source on GitHub ↗
(msg_len, sdir)

Source from the content-addressed store, hash-verified

140 return (1. - err) * 100
141
142def load_decoder_and_message(msg_len, sdir):
143 sdict = torch.load(os.path.join(sdir, f'CLIP-MsgDecoder-{msg_len}.pkl'), map_location='cpu', weights_only=True)
144 model = CLIPWatermarker(msg_len=msg_len)
145 model.load_state_dict(sdict.pop('model'))
146 for k, v in model.named_parameters():
147 v.requires_grad = False
148 message = random.choice(sdict['data'])[1]
149 return model.cuda(), message.cuda()

Callers 1

run_watermark.pyFile · 0.90

Calls 1

CLIPWatermarkerClass · 0.85

Tested by

no test coverage detected