codeslake / IFAN

[CVPR 2021] Official PyTorch Implementation for "Iterative Filter Adaptive Network for Single Image Defocus Deblurring"
GNU Affero General Public License v3.0
227 stars 39 forks source link

I have a question. #13

Closed huzippm closed 1 year ago

huzippm commented 1 year ago

hello Junyong Lee: Thanks to your great work! I have a question about lines 35 to 36 in 'models/IAC.py':kernel2 = kernel2.permute(0, 2, 3, 1).view(N, H, W, channels, ksize) feat_in = torch.sum(torch.mul(feat_in, kernel1), -1) Is it supposed to be this way:kernel2 = kernel2.permute(0, 2, 3, 1).view(N, H, W, channels, ksize) feat_in = torch.sum(torch.mul(feat_in, **kernel2**), -1) Thank you for your help! @codeslake

codeslake commented 1 year ago

Oh, you are right! It should be kernel2.

codeslake commented 1 year ago

I really appreciate the comment. I've checked old unshared codes used for the preliminary experiments, and all of them are using kernel1 for the IAC layer.

I believe the current IFAN still works, as defocus blur is usually in isotropic shape while the current IAC layer is dealing with them with isotropic separable kernels. Thanks to your comment, I've updated the readme to notify the mistake and added the comment in the code (I can't just correct the code as shared checkpoints are based on the current IAC layer). If time allows, I will update the experimental results based on the corrected IAC layer.

Thanks!

huzippm commented 1 year ago

Thank you for your answer. I believe that the model weights based on the correct code can better play the performance of the IAC layer ,and the deblurring results are better. Thanks to your great work!