Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padding #27

Closed
EricS-TW opened this issue May 11, 2018 · 4 comments
Closed

Padding #27

EricS-TW opened this issue May 11, 2018 · 4 comments

Comments

@EricS-TW
Copy link

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'])

@MBCmbc
Copy link

MBCmbc commented May 12, 2018

Where to add the setting you've given?

@MBCmbc
Copy link

MBCmbc commented May 12, 2018

Can you tell me please?

@EricS-TW
Copy link
Author

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

@chensteven
Copy link

This actually saved my life. PSNR was around 11 for me before padding. Using @EricS-TW 's solution, now my PSNR Is around 21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants