Closed EricS-TW closed 6 years ago
Where to add the setting you've given?
Can you tell me please?
Hello, I wrote some testing code myself. In this repo, the psnr result is not calculated. You have to do some coding. I can only give you some pseudo code:
(1) Read the original image (label) (2) Predict the HR image (HR will be smaller than the label, due to non-zero padding convolution) (3) Crop label like: label = label[height_padding['top']:-height_padding['buttom'], width_padding['left']:-width_padding['right']] (4) Calculate PSNR
This actually saved my life. PSNR was around 11 for me before padding. Using @EricS-TW 's solution, now my PSNR Is around 21.
I have discovered something about testing. You have to pad your left and top of your label image to be 6 and you can calculate the rest part. The result psnr will be better and closer to the paper. The setting is like:
height_padding = {} ; width_padding = {}
height_padding['top'] = 6 height_padding['buttom'] = int(abs(result.shape[0] - label.shape[0]) - height_padding['top'])
width_padding['left'] = 6 width_padding['right'] = int(abs(result.shape[1] - label.shape[1]) - width_padding['left'])