Kai-46 / PhySG

Code for PhySG: Inverse Rendering with Spherical Gaussians for Physics-based Relighting and Material Editing
MIT License
221 stars 24 forks source link

Gap of PSNR computing between eval.py and the paper #9

Closed Woolseyyy closed 2 years ago

Woolseyyy commented 2 years ago

The rendering results look good but the mean PSNR, which is computed by evaluation/eval.py, is different with the result report in the paper. Specially, I evalled the result of kitty and used same lighting as training. The mean PSNR is about 22 while the PSNR in the paper is 36.45.

And here is the reason: 1) eval.py computes PSNR of images in linear space instead of sRGB space, i.e, dose not apply "I_out = I_in ^ (1/2.2)" described in Tab.3. Although Line 204 runs tonemap_img, the gamma is 1.0. 2) calculate_psnr in eval.py Line 396 only calculates MSE on masked area instead of the whole picture. mse = np.mean((img1 - img2)**2) * (img2.shape[0] * img2.shape[1]) / mask.sum() at Line 400 should be modified as mse = np.mean((img1 - img2)**2)