Closed Zibo1109 closed 1 year ago
Your understanding is not entirely accurate. The role of the global mask is to utilize neighborhood bilinear interpolation to replace the intermediate noisy signal. This allows for the implementation of pseudo noise2noise supervision pairs while avoiding identity mapping. This method is fundamentally different from the blind-spot network. The latter performs context inpainting based on pixel-wise independent properties, which often leads to a greater loss of valuable information.
论文 Figure 2 中提到 “the global masker $\Omega_{(·)}$ hides four spots in y to create a global masked volumes $\Omega_{y}$ consisting of four masked cells $\Omega_{y}^{ij}$, $i,j\in$ {0, 1}”
并且前面也提到 “The pixels in the i-th row and j-th column of each cell are masked and filled with black for illustration”
我的理解是被 masked 的像素值应该为 0,即黑色。这就与下面的代码产生了矛盾:
https://github.com/zejinwang/Blind2Unblind/blob/c76964f2e5f041c6b331195d0af4f3d3f9b51359/train_b2u.py#L299
经过调试发现
filtered_tensor.view_as(tensor) * mask
为将论文 Figure 2 中黑色的像素变成原图原位置卷积后的像素(其余位置像素值为0),与tensor * mask_inv
相加后会导致图像没有像素值为 0 的部分(我们假设原图所有像素值非0)。或者这样考虑,mask
和mask_inv
可以看成 “对立事件”,所以在mask
和mask_inv
的“系数”都不为 0 的前提下所有像素值也不可能出现0。所以按我的理解上述代码应该修改为:
这样每 4 个像素必然有一个为 0,即实现了mask
请问我的理解是否正确,希望可以得到答复,谢谢!