sanghyun-son / EDSR-PyTorch

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

About test Set5 have some error #163

Open xiaobiaodu opened 5 years ago

xiaobiaodu commented 5 years ago

Hey, I download your predtrain model ,EDSRX2 to test Set5!. But have some pixel error image

And the PSNR of Set5 is 39.14. It seem big than your paper?

sanghyun-son commented 5 years ago

Hello.

Would you provide the test script you used? I think I can give you an answer with #164

Thank you.

xiaobiaodu commented 5 years ago

code.zip

xiaobiaodu commented 5 years ago

Hi.

I have send my code. If u want to run this code. U just modify the test.py line80 for your model path, and data_fortest.py line17 for your benchmark path(Data folder structure is same with yous).

I will appreciate you for your help! Thank you!

sanghyun-son commented 5 years ago

@echosum Sorry but for some personal reason, I cannot run your code right now.

I checked the code and thought that line 45, 47 and 48 of your `test.py may cause the problem.

This problem usually happens when the output image is not clipped well.

In other words, you need to check that pixel values of the quantized image are in [0, 255].

If not, you can simply resolve this problem by clipping them.

Please let me know if you cannot fix the problem after the solution :)

Thank you

xiaobiaodu commented 5 years ago

` hr = model(lr)

            hr = common.quantize(hr,255)

            print('range',torch.max(hr),torch.min(hr))

            hr_np = hr.cpu().data.numpy().astype('uint8').transpose(0, 2, 3, 1)

            print(np.max(hr_np),np.min(hr_np))

            img = Image.fromarray(hr_np[0],'RGB')

            img.save('results/%s'%batch['info'][0])`
xiaobiaodu commented 5 years ago

Hi. In the code that I send to you. I have fix the problem that some piexl is error.

But the PSNR is always different with the result in your paper.

I have check the range of HR image is [0,255].

The PSNR is always different with the result in your paper.

I always can't fix the problem by myself. I will appreciate you.

Thanks for your help.

xiaobiaodu commented 5 years ago

Hi I try many ways to find the problem that PSNR is wrong. I think maybe the key in the input of model.

xiaobiaodu commented 5 years ago

Hi, I have fix these problem. Thanks for your help

Ethean commented 4 years ago

@echosum hi, I downloaded the edsr_x4.pth and test it on the validation set of div2k and I got a pretty low psnr(19.7) and ssim(0.459). Then I test on set5 and the psnr still has a very low value(19.2). What could I miss?

AbdulMoqeet commented 4 years ago

@echosum Make sure, you are loading the trained model. Just setting the --pre_train download will also serve the purpose.

suxi-du commented 2 years ago

Hi, I have fix these problem. Thanks for your help

hey, how did u fix it?

ptrahuang commented 2 years ago

Hi, I have fix these problem. Thanks for your help

hey, how did u fix it?

hey ,how did u fix it ?