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

Change depth from float64 to float32 #3453

Merged

Conversation

nepfaff
Copy link
Contributor

@nepfaff nepfaff commented Sep 28, 2024

It seems weird to me that depth used float64 while everything else used float32. Moreover, we specify that "Filepath points to a 16-bit or 32-bit depth image", so I don't seem a reason behind converting it to float64. Moreover, the depth prediction is also float32 (ds_nerf_depth_loss):

loss = -torch.log(weights + EPS) * torch.exp(-((steps - termination_depth[:, None]) ** 2) / (2 * sigma)) * lengths

Here steps is float32 while termination_depth is float64. This PR changes it to also be float32.

Making this change leads to a small speedup.

Before change (float64):
Screenshot from 2024-09-28 14-39-52

After change (float32):
Screenshot from 2024-09-28 14-37-58

This is towards #3446.

@nepfaff nepfaff force-pushed the change_depth_from_64_to_32_bits branch from 11aa5a0 to d67a6ba Compare September 28, 2024 19:21
Copy link
Collaborator

@brentyi brentyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks unintentional. Thanks!!

@brentyi brentyi merged commit 6da9444 into nerfstudio-project:main Sep 28, 2024
3 checks passed
@nepfaff nepfaff deleted the change_depth_from_64_to_32_bits branch September 30, 2024 09:57
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

Successfully merging this pull request may close these issues.

2 participants