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

Reversed Depth from Midas #62

Closed
penguinflys opened this issue Sep 11, 2024 · 1 comment
Closed

Reversed Depth from Midas #62

penguinflys opened this issue Sep 11, 2024 · 1 comment

Comments

@penguinflys
Copy link

FSGS/train.py

Lines 121 to 131 in a536a64

render_pkg_pseudo = render(pseudo_cam, gaussians, pipe, background)
rendered_depth_pseudo = render_pkg_pseudo["depth"][0]
midas_depth_pseudo = estimate_depth(render_pkg_pseudo["render"], mode='train')
rendered_depth_pseudo = rendered_depth_pseudo.reshape(-1, 1)
midas_depth_pseudo = midas_depth_pseudo.reshape(-1, 1)
depth_loss_pseudo = (1 - pearson_corrcoef(rendered_depth_pseudo, -midas_depth_pseudo)).mean()
if torch.isnan(depth_loss_pseudo).sum() == 0:
loss_scale = min((iteration - args.start_sample_pseudo) / 500., 1)
loss += loss_scale * args.depth_pseudo_weight * depth_loss_pseudo

From above code, I see depth are transformed to the opposite number, but i guess that is not what reverse means, shouldn't it be 1/midas_depth_pseudo instead -midas_depth_pseudo?

Reference: isl-org/MiDaS#261

Best Regards

@penguinflys
Copy link
Author

As the papar only utilize relative depth, how to convert it to the depth seems not a big deal, i tried to use the 1/d way to produce real depth, but the rendering result gets worse. Perhaps hyperparameter should also be tuned.

more info can be found in #1

Anyways, it seems not to be a big deal.

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

1 participant