wutong16 / Voxurf

[ ICLR 2023 Spotlight ] Pytorch implementation for "Voxurf: Voxel-based Efficient and Accurate Neural Surface Reconstruction"
Other
399 stars 28 forks source link

Computing PSNR #22

Closed diegothomas closed 1 year ago

diegothomas commented 1 year ago

Hello. Thank you for your nice work. I think your project is very interesting and I am now trying to reproduce similar results as you show on your paper. I have two questions about how to compute the PSNR values. I see in your code in run.py l. 165:

p = -10. np.log10(np.mean(np.square(rgb - gt_imgs[i]))) back_p, fore_p = 0., 0. if masks is not None: back_p = -10. np.log10(np.sum(np.square(bg_rgb - bg_gt))/np.sum(1-mask)) fore_p = -10. * np.log10(np.sum(np.square(rgb - gt_imgs[i]))/np.sum(mask))

  1. How to handle background color? I think rgb is not masked by the mask image, so the foreground and full image psnr depend a lot on the color assigned to the background?
  2. Should I compute the psnr with colors encoded in float values between [0 and 1], or first rescale rgb and gt_imgs between [0 and 255] to compute the 8-bit psnr?

I would really apreciate if you can clarify these points.

wutong16 commented 1 year ago

Hi, thank you for giving attention to our work.

  1. We utilize the full image PSNR for evaluation; therefore, the background color significantly impacts the results. It is crucial to maintain a consistent background color for both training and evaluation and ensure the same calculation method across different approaches for a fair comparison.

  2. When calculating the PSNR, we encode the colors as float values in the range of [0, 1].

diegothomas commented 1 year ago

Thank you!