MCPcopy Create free account
hub / github.com/apple/ml-pointersect / get_lpips_model

Function get_lpips_model

plib/metrics.py:33–39  ·  view source on GitHub ↗

Return lpips model

(device: torch.device('cpu'))

Source from the content-addressed store, hash-verified

31
32
33def get_lpips_model(device: torch.device('cpu')) -> torch.nn.Module:
34 """
35 Return lpips model
36 """
37
38 lpips_model = LPIPS(net='vgg').to(device=device)
39 return lpips_model
40
41def lpips(
42 rgb: torch.Tensor,

Callers 1

Calls 2

deviceMethod · 0.80
toMethod · 0.45

Tested by

no test coverage detected