sunset1995 / DirectVoxGO

Direct voxel grid optimization for fast radiance field reconstruction.
https://sunset1995.github.io/dvgo
Other
1.05k stars 110 forks source link

Interval value explanation #7

Open theponpon opened 2 years ago

theponpon commented 2 years ago

First of all, thank you for this great work!

I am trying to complement the framework with background computation (similar to plenoxel background approach). However, I have a hard time understanding the following line of code:

interval = render_kwargs['stepsize'] * self.voxel_size_ratio

In my understanding, the value passed to activate_density() is the distance to the next point which in this case should be closer to something like (interpx[..., 1:] - interpx[..., :-1]) * rays_d.norm(dim=-1, keepdim=True) But when I passed this set of values, the results are much worse.

Could you explain the rational of the computation of interval? Thank you in advance,

Best regards,

Pierre

sunset1995 commented 2 years ago

I just want to make it independent to the scene scale and only relative to the based voxel grid. So no matter how large the scene is, the interval will rescale the scene for the volume rendering.

BTW, the value of self.act_shift have to be updated to np.log(1/(1-alpha_init) ** (-1/voxel_size) - 1).

theponpon commented 2 years ago

Thank you for your quick answer.

"BTW, the value of self.act_shift have to be updated to np.log(1/(1-alpha_init) ** (-1/voxel_size) - 1)."

Not sure I understand this last remark. With current value of voxel_size = 0.09, this formula would return nan value Could you elaborate on it please?

sunset1995 commented 2 years ago

My mistake. It's should be log((1-alpha_init) ** (-1/voxel_size) - 1) (the Eq9 in paper). Also, you may want to tune the alpha_init as the curve of the activation is different from my initial design.

hjxwhy commented 2 years ago

@sunset1995 Hello, thanks for your code. I am still confused about the interval, why it needs to be independent to the scene scale? As my understanding interval should be the distance between samples and are stepsize * voxel_size.

wtyuan96 commented 2 years ago

@hjxwhy same question here, I think the distance should be stepsize * voxel_size. In TensoRF, the interval/dist of raw2alpha function is also unreasonable (multiply by a predefined distance_scale), @sunset1995 Could you please explain this question? Thank you in advance