-
Notifications
You must be signed in to change notification settings - Fork 625
Support 2dgs with the latest viewer #707
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
Support 2dgs with the latest viewer #707
Conversation
|
Nice! I did something similar in #540 adding a backend option if you guys want to keep the simple_viewer as one file. The branch is a bit old but just a reference for further discussion |
|
This looks cool! But the depth rendering is pretty weird -- doesn't look like depth map at all. Is the viewer accessing the correct depth data? |
|
Let me double check. |
Recording.2025-05-27.194934.mp4Looks good now! Thanks for pointing it out. |
liruilong940607
left a comment
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.
Nice. Thanks for fixing 2DGS viewer (and trainer)!
|
Hi, thank you for the great work on gsplat! I noticed a small bug in examples/simple_trainer_2dgs.py, which seems to be related to the recent Arbitrary batching feature. The current implementation of the depth and normal rendering logic may cause bugs in some cases. It could be modified as follows: if render_tab_state.render_mode == "depth":
# normalize depth to [0, 1]
depth = render_median[0]
if render_tab_state.normalize_nearfar:
near_plane = render_tab_state.near_plane
far_plane = render_tab_state.far_plane
else:
near_plane = depth.min()
far_plane = depth.max()
depth_norm = (depth - near_plane) / (far_plane - near_plane + 1e-10)
depth_norm = torch.clip(depth_norm, 0, 1)
if render_tab_state.inverse:
depth_norm = 1 - depth_norm
renders = apply_float_colormap(depth_norm, render_tab_state.colormap).cpu().numpy()
elif render_tab_state.render_mode == "normal":
render_normals = render_normals[0] * 0.5 + 0.5 # normalize to [0, 1]
renders = render_normals.cpu().numpy()
elif render_tab_state.render_mode == "alpha":
alpha = render_alphas[0, ..., 0:1]
renders = apply_float_colormap(alpha, render_tab_state.colormap).cpu().numpy()This small change fixes the depth and normal rendering bugs. Thanks again for the excellent repo! |
Recording.2025-05-25.172251.mp4
This PR adds support for running 2DGS with the latest version of nerfview, ensuring compatibility and functionality. Without this update, 2DGS cannot be executed properly. Render mode supports rgb, depth, normal, and alpha.
Replaced the use of colormap with apply_float_colormap. While both provide similar logic, colormap triggers runtime errors in my environment. Suggest to unify the function usage and stick to apply_float_colormap.