Skip to content

Florian-Barthel/splatviz

Repository files navigation

splatviz

GitHub top language GitHub Release GitHub last commit Static Badge Static Badge

This interactive viewer allows you to display and edit 3D Gaussian Splatting scenes in real time. By using the python GUI library (pyimgui) we can directly manipulate the Gaussian python object just before rendering. This enables endless editing and visualization possibilities.

Additionally, you can visualize multiple scenes at the same time by comparing them side by side or in a splitscreen view or evaluate python expressions on the resulting scene.

See some example editings in this video.

NEW UPDATE: GAN related features were moved to https://github.com/Florian-Barthel/ganviz

Install

1. Clone the repository

git clone https://github.com/Florian-Barthel/splatviz.git
cd splatviz

2. Install Env

Create environment with conda:

conda env create -f environment.yml
conda activate splatviz

git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization
pip install ./diff-gaussian-rasterization

Alternatively, use micromamba:

micromamba env create --file environment.yml --channel-priority flexible -y
micromamba activate splatviz

git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization
pip install ./diff-gaussian-rasterization

Launch

In some cases you will have to add this variable so that opengl uses the correct version: export MESA_GL_VERSION_OVERRIDE=3.3

View 3D scenes

The default mode loads and renders standard 3DGS scenes stored in ply files or compressed yml files.

python run_main.py

Download example scenes here.

Attach to Training

Attaches to a running training (local or remote). By default, the splatviz listens to the local host 127.0.0.1:6007, which is used by 3DGS. Modify the host and port with --host and --port.

python run_main.py --mode=attach

Optional: To enable editing the scene during training, follow the steps described here.

Widgets

🛠️ Edit Widget

The edit widget is the core functionality of this 3D viewer. It allows for real time editing of the gaussian python object during runtime. The python code that you type in this text area will be executed just before rendering. An example could look like this, where all scales are set to -8 (before activating with exp()) and all opacity values are set to 10 (before activating with sigmoid()), while also the background is set to 1, which corresponds to white.

gs._scaling = gs._scaling * 0 - 8
gs._opacity = gs._opacity * 0 + 10

To enable smooth editing transitions, you can create sliders (press Add Slider) which you can access in the editor text by typing slider.name (eg. slider.x). An example could look as follows. Here, we create a boolean mask that filters all gaussians that are smaller than the value stored in slider.x.

mask = torch.linalg.norm(gs._scaling, dim=-1) < slider.x

gs._xyz = gs._xyz[mask]
gs._rotation = gs._rotation[mask]
gs._scaling = gs._scaling[mask]
gs._opacity = gs._opacity[mask]
gs._features_dc = gs._features_dc[mask]
gs._features_rest = gs._features_rest[mask]

Lastly, you can save and load presets of code snippets so that you don't have to type the same code again after closing the application. Those presets are stored in a .json file (presets.json).

🔍 Eval Widget

The evaluate widget can be used to debug the gaussian splatting object. By typing python code, which is executed after the rendering, you can access any variable from the rendering context and visualize them in a histogram. Some useful variables might be:

  • gaussian
  • render
  • render_cam
  • self

You can also access variables that you have defined in the editor of the Edit Widget.

🎥 Camera Widget

In the camera widget you can define the type and parameters of the camera. Most importantly, you can choose between the two modes Orbit and WASD. In Orbit mode, the camera is looking at a specific point in 3D space, and you control the pitch and yaw of the camera rotating on a sphere around that point by dragging with the mouse over the rendered view. And in WASD mode, you fly through the scene using the mouse and the WASD keys similar to the camera controls in Unity.

⭐ Recent Features

Version 1.2.0

  • 2025-09-20: Fix eval widget.
  • 2025-09-20: Fix import of diff-gaussian-splatting package.
  • 2025-09-20: Simplify the camera widget.
  • 2025-09-20: Refactor scene loading widget to load the scenes from a file browser.
  • 2025-09-18: Move GAN mode to a new repository: https://github.com/Florian-Barthel/ganviz
  • 2025-05-26: Added GAN mode.

Version 1.1.0

  • 2024-08-12: Added a new Training Widget to inspect live training stats and to pause training
  • 2024-08-11: Attach to a running 3DGS training
  • 2024-08-10: Refactor rendering class for easier addition of new renderer
  • 2024-08-07: Better Mouse Control (translate with middle mouse button)
  • 2024-08-05: Allow editing of existing sliders
  • 2024-07-30: Store slider values in presets
  • 2024-07-28: New Performance Widget
  • 2024-07-28: Editor now highlights special variables (gs, self, slider) and gives tooltips

Version 1.0.0

  • 2024-07-12: Rebuild the whole application with imgui_bundle
  • 2024-07-05: Compare two or more Gaussian Splatting scenes side by side

Citation

If you find this viewer useful, please consider citing our work:

@misc{barthel2024gaussian,
    title={Gaussian Splatting Decoder for 3D-aware Generative Adversarial Networks}, 
    author={Florian Barthel and Arian Beckmann and Wieland Morgenstern and Anna Hilsmann and Peter Eisert},
    year={2024},
    eprint={2404.10625},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

References

This viewer is inspired by the visualizer from Efficient Geometry-aware 3D Generative Adversarial Networks (EG3D).

About

Full python interactive 3D Gaussian Splatting viewer for real-time editing and analyzing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages