sxyu / svox2

Plenoxels: Radiance Fields without Neural Networks
BSD 2-Clause "Simplified" License
2.79k stars 360 forks source link

Modify code to get gradients of the depth #72

Open techarek opened 2 years ago

techarek commented 2 years ago

I am trying to get the gradients of the voxels of the depth instead of the radiance. The radiance gradients are computed in volume_render_fused and I am wondering how I can change this to get gradients of depth. I presume I have to change the volume_render_cuvol_fused cuda function which calls render_ray_kernel and render_ray_backward_kernel with arguments of rgb_out not depth. Currently the depth is computed in volume_render_depth which doesn't compute gradients.

Is there an easier way to do this so that render_ray_backward_kernel can output d(rgb_out)/d(voxel) and d(depth)/d(voxel)?

zhw-github commented 1 year ago

I have the same question,and how to render zdepth with finding weight

ericzzj1989 commented 1 year ago

@techarek Hi, may I ask if you have already added the gradients of the depth?

ChenLu-china commented 1 year ago

I found that the output depth is not accurate after I check the code. Some rays can' t reached the far distance depth which more than 1.2.

ericzzj1989 commented 1 year ago

@ChenLu-china Can we discuss this issue together? My Wechat is chiu_jing_chun, we could add WeChat each other for further discussing if it is convenient for you :)