The-Learning-And-Vision-Atelier-LAVA / DASR

[CVPR 2021] Unsupervised Degradation Representation Learning for Blind Super-Resolution
MIT License
387 stars 50 forks source link

a problem in utils/util.py #61

Open zhangjinyangnwpu opened 2 years ago

zhangjinyangnwpu commented 2 years ago

I have a little confuse about line 302 in util.py

lr_blured = torch.clamp(lr_blured.round(), 0, 255)

is that right for a (0,1) tensor? when we use degrade for training, dose tensor value between (0,255)?

maybe the following code is more suitable?

lr_blured = torch.clamp(lr_blured, 0, 1)

LongguangWang commented 2 years ago

Hi @zhangjinyangnwpu, input LR images with ranges [0, 1] and [0, 255] are both okay for SR networks. In this work, we follow EDSR and RCAN to use images with range [0, 255] as the input of our network.