MCPcopy Index your code
hub / github.com/ZhengPeng7/BiRefNet / create_window

Function create_window

loss.py:220–224  ·  view source on GitHub ↗
(window_size, channel)

Source from the content-addressed store, hash-verified

218
219
220def create_window(window_size, channel):
221 _1D_window = gaussian(window_size, 1.5).unsqueeze(1)
222 _2D_window = _1D_window.mm(_1D_window.t()).float().unsqueeze(0).unsqueeze(0)
223 window = Variable(_2D_window.expand(channel, 1, window_size, window_size).contiguous())
224 return window
225
226
227def _ssim(img1, img2, window, window_size, channel, size_average=True):

Callers 2

__init__Method · 0.85
forwardMethod · 0.85

Calls 1

gaussianFunction · 0.85

Tested by

no test coverage detected