EDSR-PyTorch icon indicating copy to clipboard operation
EDSR-PyTorch copied to clipboard

About test Set5 have some error

Open xiaobiaodu opened this issue 5 years ago • 12 comments

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?

xiaobiaodu avatar May 08 '19 01:05 xiaobiaodu

Hello.

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

Thank you.

sanghyun-son avatar May 08 '19 19:05 sanghyun-son

code.zip

xiaobiaodu avatar May 09 '19 01:05 xiaobiaodu

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!

xiaobiaodu avatar May 09 '19 01:05 xiaobiaodu

@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

sanghyun-son avatar May 09 '19 19:05 sanghyun-son

` 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 avatar May 09 '19 23:05 xiaobiaodu

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 avatar May 09 '19 23:05 xiaobiaodu

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

xiaobiaodu avatar May 10 '19 15:05 xiaobiaodu

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

xiaobiaodu avatar May 11 '19 02:05 xiaobiaodu

@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?

Ethean avatar Nov 12 '19 13:11 Ethean

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

AbdulMoqeet avatar Dec 16 '19 08:12 AbdulMoqeet

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

hey, how did u fix it?

suxi-du avatar Dec 24 '21 07:12 suxi-du

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

hey, how did u fix it?

hey ,how did u fix it ?

ptrahuang avatar Oct 21 '22 04:10 ptrahuang