sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.43k stars 669 forks source link

Issue in Meanshift while training on 16 bit, 1 channel tiff images? #257

Open ahanagemini opened 4 years ago

ahanagemini commented 4 years ago

Meanshift assumes 3 channels and so the code needs to be re-written for 1 channel? Also, the default RGB mean values are around 0.4 for each channel. This seems to indicate that data should be in the range 0-1. However, from the code, it seems that the data is in the range of 0-255. If so, then how are the means so small?

HaolyShiit commented 4 years ago

I think it should be: out = (in - mean 255) / sigma, according to author's codes, if input images are at 0 ~ 255. So the final range is -(mean 255) ~ +(255 - mean * 255), roughly at -127~+127.

ahanagemini commented 4 years ago

I see. So, that part of the code should be modified/ corrected?

On Thu, 26 Mar 2020 at 07:02, haodejun notifications@github.com wrote:

I think it should be: out = (in - mean * 255) / sigma, according to author's codes, if input images are at 0255. So the final range is -(mean

  • 255) ~ +(255 - mean * 255), roughly at -127+127.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thstkdgus35/EDSR-PyTorch/issues/257#issuecomment-604365188, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTJUXLRP7BXSEILUGW3I3LRJMY3DANCNFSM4LTEUWHQ .