(window_size, channel)
| 208 | |
| 209 | |
| 210 | def create_window(window_size, channel): |
| 211 | _1D_window = gaussian(window_size, 1.5).unsqueeze(1) |
| 212 | _2D_window = _1D_window.mm(_1D_window.t()).float().unsqueeze(0).unsqueeze(0) |
| 213 | window = Variable(_2D_window.expand(channel, 1, window_size, window_size).contiguous()) |
| 214 | return window |
| 215 | |
| 216 | |
| 217 | def _ssim(img1, img2, window, window_size, channel, size_average=True): |
no test coverage detected