cszn / KAIR

Image Restoration Toolbox (PyTorch). Training and testing codes for DPIR, USRNet, DnCNN, FFDNet, SRMD, DPSR, BSRGAN, SwinIR

Home Page:https://cszn.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Is there a problem with the PSNR calculation process in the code?"

meatpie1231 opened this issue · comments

"Hello, I noticed there is an issue with the PSNR calculation in the code. In the code, the image range is from 0 to 255, but in the PSNR calculation, the maximum grayscale value of the image has been set to 1."

Hello, which code do you mean?
I checked the code that the range had been converted to 0~255 before caculation PSNR.

image

return np.uint8((img*255.0).round())

return 20 * math.log10(255.0 / math.sqrt(mse))