-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace depth alpha mask logic with torch.where for gradients in splatfacto #2856
Conversation
This reverts commit 70ade42.
This reverts commit 70d83d4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -779,8 +779,7 @@ def get_outputs(self, camera: Cameras) -> Dict[str, Union[torch.Tensor, List]]: | |||
W, | |||
background=torch.zeros(3, device=self.device), | |||
)[..., 0:1] # type: ignore | |||
depth_im[alpha > 0] = depth_im[alpha > 0] / alpha[alpha > 0] | |||
depth_im[alpha == 0] = 1000 | |||
depth_im = torch.where(alpha > 0, depth_im / alpha, depth_im.detach().max()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an unrelated comment, compute the mean(depth) has very high variance in estimation. I would prefer to compute mean(1/depth) as this is more related to disparity maps across views.
…tfacto (nerfstudio-project#2856) * replace alpha depth logic with torch.where for differentiability
No description provided.