JihyongOh / JSI-GAN

[AAAI 2020] Official repository of JSI-GAN.
60 stars 16 forks source link

Calculation of SSIM #28

Closed clearlon closed 2 years ago

clearlon commented 2 years ago

Hi, Thanks for the awesome work. I can't reproduce the SSIM in the JSI-GAN paper when using Deep-SR-ITM/utils/ssim_index_new.m to calculate the SSIM between GT and Pred. The Pred is obtained by direct inference from JSI-GAN/checkpoint_dir. Specifically, the SSIMs I calculated for JSInet and JSI-GAN are 0.9401 and 0.9330, respectively. The codes are as follows:

gt_img = double(imread(gt_folder))
pred_img = double(imread(pred_folder))
[mssim, ssim_map, mcs, cs_map] = ssim_index_new(gt_img, pred_img, K, win, 1023)
sooyekim commented 2 years ago

Hi @clearlon ,

Thanks for your interest in our work! For measuring SSIM, you can just use the ssim() function on Matlab after dividing by 1023, like this:

pred_YUV = double(pred_YUV)/1023;
gt_YUV = double(gt_YUV)/1023;
ssim_val = ssim(pred_YUV, gt_YUV);

The Deep-SR-ITM/utils/ssim_index_new.m function is used for measuring MS-SSIM. Feel free to post here if you have anymore questions!

clearlon commented 2 years ago

Thank you for your reply. My issue is well addressed.