dazinovic / neural-rgbd-surface-reconstruction

Official implementation of the CVPR 2022 Paper "Neural RGB-D Surface Reconstruction"

Home Page:https://dazinovic.github.io/neural-rgbd-surface-reconstruction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find piece of code that normalizes predicted sdf to lie between -1 and 1

andrewsonga opened this issue · comments

Hello,

I'm trying to follow up on the discussion in issue #12 about how the predicted SDF is defined (i.e. whether it is defined in the metric space or the normalized space [-1, 1]). You mentioned that "predicted SDF is always normalized between -1 (behind the surface) and +1 (in front of the surface)". However, I couldn't find anywhere in the code where the SDF output from the NeRF MLP is explicitly constrained to fall within the range [-1, 1] (for e.g. via a tanh activation) - there does not seem to be any activation applied when computing alpha_out in the function init_nerf_model from

if use_viewdirs:
alpha_out = dense(1, act=None)(outputs)
bottleneck = dense(256, act=None)(outputs)
inputs_viewdirs = tf.concat([bottleneck, inputs_views], -1) # concat viewdirs
outputs = inputs_viewdirs
for i in range(1):
outputs = dense(W//2)(outputs)
outputs = dense(3, act=None)(outputs)
outputs = tf.concat([outputs, alpha_out], -1)
else:
outputs = dense(output_ch, act=None)(outputs)
.

Could you please direct me to where exactly in the codebase the predicted SDF is normalized?
Thank you in advance!

commented

There is no explicit normalization. The freespace and truncation losses push the predicted SDF towards the [-1, 1] range.