google-research / multinerf

A Code Release for Mip-NeRF 360, Ref-NeRF, and RawNeRF
Apache License 2.0
3.57k stars 338 forks source link

why multiply -1 to viewdirs in orientation_loss #89

Closed CSU-NXY closed 1 year ago

CSU-NXY commented 1 year ago

Hi, I noticed that in orientation_loss, the viewdirs are multiplied with -1. The comment says this is to represent normalized vectors from point to camera.

v = -1. * rays.viewdirs
n_dot_v = (n * v[..., None, :]).sum(axis=-1)

This seems to be different with equation 11 in ref-nerf paper. Could you please give me some hints about it?

CSU-NXY commented 1 year ago

Sorry I misunderstood. The loss is computed with minimum instead of maximum, so the implementation is correct. https://github.com/google-research/multinerf/blob/b02228160d3179300c7d499dca28cb9ca3677f32/internal/train_utils.py#L167