DeokyunKim / Progressive-Face-Super-Resolution

Official Pytorch Implementation of Progressive Face Super-Resolution (BMVC 2019 Accepted)
261 stars 60 forks source link

Why do we multiply by 0.5 and adding 0.5 when calculatin PSNR, SSIM and MS-SSIM ? #6

Closed JauB1981 closed 5 years ago

JauB1981 commented 5 years ago

Hi Why do we multiply by 0.5 and adding 0.5 when calculatin PSNR, SSIM and MS-SSIM ? i.e here : ` mse_loss = MSE_Loss(0.5predicted_image+0.5, 0.5target_image+0.5)
_ssim = ssim(0.5predicted_image+0.5, 0.5target_image+0.5)

ms_ssim = msssim(0.5predicted_image+0.5, 0.5target_image+0.5)`

And if I want to compare for example PSNR for Progressive Face SR and PSNR of FSRNet, should i do the same operation by multiplying by 0.5 and adding 0.5 or it depends on the Network ? Thanks.

DeokyunKim commented 5 years ago

Because the dataset is normalized by ((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)). The uploaded model is trained with normalized dataset. Therefore, we multiply and add 0.5 . Please refere the dataloader.py

JauB1981 commented 5 years ago

OK thanks. I got it ;)