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

Function ssim

utils/loss_utils.py:55–63  ·  view source on GitHub ↗
(img1, img2, window_size=11, size_average=True)

Source from the content-addressed store, hash-verified

53 return window
54
55def ssim(img1, img2, window_size=11, size_average=True):
56 channel = img1.size(-3)
57 window = create_window(window_size, channel)
58
59 if img1.is_cuda:
60 window = window.cuda(img1.get_device())
61 window = window.type_as(img1)
62
63 return _ssim(img1, img2, window, window_size, channel, size_average)
64
65def _ssim(img1, img2, window, window_size, channel, size_average=True):
66 mu1 = F.conv2d(img1, window, padding=window_size // 2, groups=channel)

Callers 2

trainingFunction · 0.90
evaluateFunction · 0.90

Calls 3

create_windowFunction · 0.85
_ssimFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected