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

Method forward

loss.py:201–212  ·  view source on GitHub ↗
(self, img1, img2)

Source from the content-addressed store, hash-verified

199 self.window = create_window(window_size, self.channel)
200
201 def forward(self, img1, img2):
202 (_, channel, _, _) = img1.size()
203 if channel == self.channel and self.window.data.type() == img1.data.type():
204 window = self.window
205 else:
206 window = create_window(self.window_size, channel)
207 if img1.is_cuda:
208 window = window.cuda(img1.get_device())
209 window = window.type_as(img1)
210 self.window = window
211 self.channel = channel
212 return 1 - _ssim(img1, img2, window, self.window_size, channel, self.size_average)
213
214
215def gaussian(window_size, sigma):

Callers

nothing calls this directly

Calls 2

create_windowFunction · 0.85
_ssimFunction · 0.85

Tested by

no test coverage detected