Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some questions about depth_loss #18

Closed
LiXinghui-666 opened this issue Oct 11, 2022 · 3 comments
Closed

some questions about depth_loss #18

LiXinghui-666 opened this issue Oct 11, 2022 · 3 comments

Comments

@LiXinghui-666
Copy link

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
Copy link
Member

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
Copy link
Author

Thank you for your reply!

@LiXinghui-666
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants