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

Fix edge case of depth colormap #3139

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nerfstudio/utils/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def apply_depth_colormap(
Colored depth image with colors in [0, 1]
"""

near_plane = near_plane or float(torch.min(depth))
far_plane = far_plane or float(torch.max(depth))
near_plane = near_plane if near_plane is not None else float(torch.min(depth))
far_plane = far_plane if far_plane is not None else float(torch.max(depth))

depth = (depth - near_plane) / (far_plane - near_plane + 1e-10)
depth = torch.clip(depth, 0, 1)
Expand Down
Loading