MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / ssim

Function ssim

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

Source from the content-addressed store, hash-verified

32 return window
33
34def ssim(img1, img2, window_size=11, size_average=True):
35 channel = img1.size(-3)
36 window = create_window(window_size, channel)
37
38 if img1.is_cuda:
39 window = window.cuda(img1.get_device())
40 window = window.type_as(img1)
41
42 return _ssim(img1, img2, window, window_size, channel, size_average)
43
44def _ssim(img1, img2, window, window_size, channel, size_average=True):
45 mu1 = F.conv2d(img1, window, padding=window_size // 2, groups=channel)

Callers

nothing calls this directly

Calls 2

create_windowFunction · 0.85
_ssimFunction · 0.85

Tested by

no test coverage detected