MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / __init__

Method __init__

lpipsPyTorch/modules/lpips.py:17–28  ·  view source on GitHub ↗
(self, net_type: str = 'alex', version: str = '0.1')

Source from the content-addressed store, hash-verified

15 version (str): the version of LPIPS. Default: 0.1.
16 """
17 def __init__(self, net_type: str = 'alex', version: str = '0.1'):
18
19 assert version in ['0.1'], 'v0.1 is only supported now'
20
21 super(LPIPS, self).__init__()
22
23 # pretrained network
24 self.net = get_network(net_type)
25
26 # linear layers
27 self.lin = LinLayers(self.net.n_channels_list)
28 self.lin.load_state_dict(get_state_dict(net_type, version))
29
30 def forward(self, x: torch.Tensor, y: torch.Tensor):
31 feat_x, feat_y = self.net(x), self.net(y)

Callers

nothing calls this directly

Calls 4

get_networkFunction · 0.85
LinLayersClass · 0.85
get_state_dictFunction · 0.85
load_state_dictMethod · 0.45

Tested by

no test coverage detected