autonomousvision / monosdf

[NeurIPS'22] MonoSDF: Exploring Monocular Geometric Cues for Neural Implicit Surface Reconstruction
MIT License
573 stars 53 forks source link

some questions about depth_loss #18

Closed LiXinghui-666 closed 2 years ago

LiXinghui-666 commented 2 years ago

Thank you for your excellent work. I would like to know why is this operation performed on depth_gt when depth loss is calculated:(*depth_gt 50 + 0.5**). Corresponding to this line of code:

def get_depth_loss(self, depth_pred, depth_gt, mask):
        # TODO remove hard-coded scaling for depth
        return self.depth_loss(depth_pred.reshape(1, 32, 32), (depth_gt * 50 + 0.5).reshape(1, 32, 32), mask.reshape(1, 32, 32))
niujinshuchong commented 2 years ago

Hi, the monocular depth output is small and it's in the range of 0.01 to 0.04, and the loss will be very small so we simply scale them to some large value.

LiXinghui-666 commented 2 years ago

Thank you for your reply!

LiXinghui-666 commented 2 years ago

culart

Hi, the monocular depth output is small and it's in the range of 0.01 to 0.04, and the loss will be very small so we simply scale them to some large value.

There's the same question about scale scaling. Since a scale and shift are calculated in advance when the depth loss is calculated, what is the function of the following line in the code?

# we should use unnormalized ray direction for depth
ray_dirs_tmp, _ = rend_util.get_camera_params(uv, torch.eye(4).to(pose.device)[None], intrinsics)
depth_scale = ray_dirs_tmp[0, :, 2:]
depth_values = depth_scale * depth_values