advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
7.99k stars 849 forks source link

Question on masked_l1_loss #46

Closed lovecambi closed 2 years ago

lovecambi commented 2 years ago

For the function masked_l1_loss (https://github.com/saic-mdal/lama/blob/main/saicinpainting/training/losses/feature_matching.py#L13), I found weight_known=10 and weight_missing=0 in all config yaml files, so the masked_l1_loss won't calculate the difference on masked region. This seems counter-intuitive. Can you explain the reason?

windj007 commented 2 years ago

Hi Sorry for late reply

No, there is no reason. L1 is only applied to the known part of the image and to the best of our knowledge, does not affect training. It is there just for historical reasons. You can turn L1 loss off altogether and everything should be fine