Lukas Radl*,
Michael Steiner*,
Mathias Parger,
Alexander Weinrauch,
Bernhard Kerbl,
Markus Steinberger
* denotes equal contribution
| Webpage
| Full Paper
| Video
| T&T+DB COLMAP (650MB)
| Pre-trained Models (18.13 GB)
This repository contains the official authors implementation associated with the paper "StopThePop: Sorted Gaussian Splatting for View-Consistent Real-time Rendering", which can be found here.
Abstract: Gaussian Splatting has emerged as a prominent model for constructing 3D representations from images across diverse domains. However, the efficiency of the 3D Gaussian Splatting rendering pipeline relies on several simplifications. Notably, reducing Gaussian to 2D splats with a single view-space depth introduces popping and blending artifacts during view rotation. Addressing this issue requires accurate per-pixel depth computation, yet a full per-pixel sort proves excessively costly compared to a global sort operation. In this paper, we present a novel hierarchical rasterization approach that systematically resorts and culls splats with minimal processing overhead. Our software rasterizer effectively eliminates popping artifacts and view inconsistencies, as demonstrated through both quantitative and qualitative measurements. Simultaneously, our method mitigates the potential for cheating view-dependent effects with popping, ensuring a more authentic representation. Despite the elimination of cheating, our approach achieves comparable quantitative results for test images, while increasing the consistency for novel view synthesis in motion. Due to its design, our hierarchical approach is only 4% slower on average than the original Gaussian Splatting. Notably, enforcing consistency enables a reduction in the number of Gaussians by approximately half with nearly identical quality and view-consistency. Consequently, rendering performance is nearly doubled, making our approach 1.6x faster than the original Gaussian Splatting, with a 50% reduction in memory requirements.
@article{radl2024stopthepop,
author = {Radl, Lukas and Steiner, Michael and Parger, Mathias and Weinrauch, Alexander and Kerbl, Bernhard and Steinberger, Markus},
title = {{StopThePop: Sorted Gaussian Splatting for View-Consistent Real-time Rendering}},
journal = {ACM Transactions on Graphics},
number = {4},
volume = {43},
articleno = {64},
year = {2024},
}
Our repository is built on 3D Gaussian Splatting: For a full breakdown on how to get the code running, please consider 3DGS's Readme.
The project is split into submodules, each maintained in a separate github repository:
- StopThePop-Rasterization: A clone of the original diff-gaussian-rasterization that contains our CUDA hierarchical rasterizer implementation
- SIBR_StopThePop: A clone of the SIBR Core project, containing an adapted viewer with our additional settings and functionalities
- PoppingDetection: A self-contained module for our proposed popping detection metric
The majority of the projects is licensed under the "Gaussian-Splatting License", with the exception of:
- PoppingDetection: MIT License
- StopThePop header files: MIT License
- FLIP: BSD-3 license
There are also several changes in the original source code. If you use any of our additional functionalities, please cite our paper and link to this repository.
The repository contains submodules, thus please check it out with
# HTTPS
git clone https://github.com/r4dl/StopThePop --recursive
Our default, provided install method is based on Conda package and environment management:
SET DISTUTILS_USE_SDK=1 # Windows only
conda env create --file environment.yml
conda activate stopthepop
Note: This process assumes that you have CUDA SDK 11 installed. Optionally, you can use CUDA 12 and Pytorch 2.1, by using
environment_cuda12.yml
instead ofenvironment.yml
.
Subsequently, install the CUDA rasterizer:
pip install submodules/diff-gaussian-rasterization
Note: This can take several minutes. If you experience unreasonably long build times, consider using our fast build mode.
Our implementation includes 4 flavors of Gaussian Splatting:
Fast | View-Consistent | |
3DGS | ✅ | ❌ |
Full Sort | 🐢 | ✅ |
KBuffer | ✅ | ✅ |
Ours (recommended) | ✅ | ✅ |
Note: Our hierarchical rasterizer is both faster and more view-consistent compared to the naïve KBuffer method.
The train.py
script takes a .json
config file as the argument --splatting_config
, which should contain the following information (this example is also the default config.json
, if none is provided):
{
"sort_settings":
{
"sort_mode": 0, // Global (0), Per-Pixel Full (1), Per-Pixel K-Buffer (2), Hierarchical (3)
"sort_order": 0, /* Viewspace Z-Depth (0), Worldspace Distance (1),
Per-Tile Depth at Tile Center (2), Per-Tile Depth at Max Contrib. Pos. (3) */
"queue_sizes":
{
"per_pixel": 4, // Used for: Per-Pixel K-Buffer and Hierarchical
"tile_2x2": 8, // Used only for Hierarchical
"tile_4x4": 64 // Used only for Hierarchical
}
},
"culling_settings":
{
"rect_bounding": false, // Bound 2D Gaussians with a rectangle (instead of a square)
"tight_opacity_bounding": false, // Bound 2D Gaussians by considering their opacity value
"tile_based_culling": false, /* Cull Tiles where the max. contribution is below the alpha threshold;
Recommended to be used together with Load Balancing*/
"hierarchical_4x4_culling": false, // Used only for Hierarchical
},
"load_balancing": false, // Use load balancing for per-tile calculations (culling, depth, and duplication)
"proper_ewa_scaling": false, /* Proper dilation of opacity, as proposed by Yu et al. ("Mip-Splatting");
Model also needs to be trained with this setting */
}
These values can be overwritten through the command line.
Call python train.py --help
to see all available options.
At the start of training, the provided arguments will be written into the output directory.
The render.py
script uses the config.json
in the model directory per default, with the option to overwrite through the command line.
To train different example models (see the corresponding config files for the used settings), run:
# Our Hierarchical Rasterizer, as proposed in StopThePop
python train.py --splatting_config configs/hierarchical.json -s <path to COLMAP or NeRF Synthetic dataset>
# Vanilla 3DGS
python train.py --splatting_config configs/vanilla.json -s <path to COLMAP or NeRF Synthetic dataset>
# Per-Pixel K-Buffer Sort (Queue Size 16)
python train.py --splatting_config configs/kbuffer.json -s <path to COLMAP or NeRF Synthetic dataset>
New Command Line Arguments for train.py
Train with Opacity Decay - this results in comparable image metrics with significantly fewer Gaussians. We used --opacity_decay 0.9995
for the reported results in our paper.
Full config to specify the flavor of Gaussian Splatting. See configs/
for pre-defined configs.
Specify Sort Mode - must be one of {GLOBAL,PPX_FULL,PPX_KBUFFER,HIER}
Specify Sort Order - must be one of {Z_DEPTH,DISTANCE,PTD_CENTER,PTD_MAX}
Specify size of 4x4 tile queue - only needed if using sort_mode HIER
, only 64
supported.
Specify size of 2x2 tile queue - only needed if using sort_mode HIER
, only {8,12,20}
supported.
Specify size of per-pixel queue: If using sort_mode HIER
, only {4,8,16}
supported. If using sort_mode KBUFFER
, all values are supported.
Bound 2D Gaussians with a rectangle instead of a circle - must be one of {True,False}
Bound 2D Gaussians by considering their opacity - must be one of {True,False}
Cull complete tiles based on opacity - must be one of {True,False}
(recommended with Load Balancing)
Cull Gaussians for 4x4 subtiles - must be one of {True,False}
, only when using sort_mode HIER
Perform per-tile computations cooperatively (e.g. duplication) - must be one of {True,False}
Dilation of 2D Gaussians as proposed by Yu et al. ("Mip-Splatting") - must be one of {True,False}
Original Command Line Arguments for train.py
Path to the source directory containing a COLMAP or Synthetic NeRF data set.
Path where the trained model should be stored (output/<random>
by default).
Alternative subdirectory for COLMAP images (images
by default).
Add this flag to use a MipNeRF360-style training/test split for evaluation.
Specifies resolution of the loaded images before training. If provided 1, 2, 4
or 8
, uses original, 1/2, 1/4 or 1/8 resolution, respectively. For all other values, rescales the width to the given number while maintaining image aspect. If not set and input image width exceeds 1.6K pixels, inputs are automatically rescaled to this target.
Specifies where to put the source image data, cuda
by default, recommended to use cpu
if training on large/high-resolution dataset, will reduce VRAM consumption, but slightly slow down training. Thanks to HrsPythonix.
Add this flag to use white background instead of black (default), e.g., for evaluation of NeRF Synthetic dataset.
Order of spherical harmonics to be used (no larger than 3). 3
by default.
Flag to make pipeline compute forward and backward of SHs with PyTorch instead of ours.
Flag to make pipeline compute forward and backward of the 3D covariance with PyTorch instead of ours.
Enables debug mode if you experience erros. If the rasterizer fails, a dump
file is created that you may forward to us in an issue so we can take a look.
Debugging is slow. You may specify an iteration (starting from 0) after which the above debugging becomes active.
Number of total iterations to train for, 30_000
by default.
IP to start GUI server on, 127.0.0.1
by default.
Port to use for GUI server, 6009
by default.
Space-separated iterations at which the training script computes L1 and PSNR over test set, 7000 30000
by default.
Space-separated iterations at which the training script saves the Gaussian model, 7000 30000 <iterations>
by default.
Space-separated iterations at which to store a checkpoint for continuing later, saved in the model directory.
Path to a saved checkpoint to continue training from.
Flag to omit any text written to standard out pipe.
Spherical harmonics features learning rate, 0.0025
by default.
Opacity learning rate, 0.05
by default.
Scaling learning rate, 0.005
by default.
Rotation learning rate, 0.001
by default.
Number of steps (from 0) where position learning rate goes from initial
to final
. 30_000
by default.
Initial 3D position learning rate, 0.00016
by default.
Final 3D position learning rate, 0.0000016
by default.
Position learning rate multiplier (cf. Plenoxels), 0.01
by default.
Iteration where densification starts, 500
by default.
Iteration where densification stops, 15_000
by default.
Limit that decides if points should be densified based on 2D position gradient, 0.0002
by default.
How frequently to densify, 100
(every 100 iterations) by default.
How frequently to reset opacity, 3_000
by default.
Influence of SSIM on total loss from 0 to 1, 0.2
by default.
Percentage of scene extent (0--1) a point must exceed to be forcibly densified, 0.01
by default.
By default, the trained models use all available images in the dataset.
To train them while withholding a test set for evaluation, use the --eval
flag.
This way, you can render training/test sets and produce error metrics as follows:
python train.py -s <path to COLMAP or NeRF Synthetic dataset> --eval # Train with train/test split
python render.py -m <path to trained model> # Generate renderings and gaussian count
python metrics.py -m <path to trained model> # Compute error metrics on renderings
Our repository additionally permits rendering of Depth, visualized with the Turbo colormap. To render depth, run
python render.py -m <path to trained model> --render_depth
New Command Line Arguments for render.py
Flag to enable depth rendering.
Flag to skip rendering the training set.
Flag to skip rendering the test set.
Original Command Line Arguments for render.py
Path to the trained model directory you want to create renderings for.
Flag to omit any text written to standard out pipe.
The below parameters will be read automatically from the model path, based on what was used for training. However, you may override them by providing them explicitly on the command line.
Path to the source directory containing a COLMAP or Synthetic NeRF data set.
Alternative subdirectory for COLMAP images (images
by default).
Add this flag to use a MipNeRF360-style training/test split for evaluation.
Changes the resolution of the loaded images before training. If provided 1, 2, 4
or 8
, uses original, 1/2, 1/4 or 1/8 resolution, respectively. For all other values, rescales the width to the given number while maintaining image aspect. 1
by default.
Add this flag to use white background instead of black (default), e.g., for evaluation of NeRF Synthetic dataset.
Flag to make pipeline render with computed SHs from PyTorch instead of ours.
Flag to make pipeline render with computed 3D covariance from PyTorch instead of ours.
Original Command Line Arguments for metrics.py
Space-separated list of model paths for which metrics should be computed.
We further provide the full_eval.py
script.
This script specifies the routine used in our evaluation and demonstrates the use of some additional parameters, e.g., --images (-i)
to define alternative image directories within COLMAP data sets.
If you have downloaded and extracted all the training data, you can run it like this:
python full_eval.py -m360 <mipnerf360 folder> -tat <tanks and temples folder> -db <deep blending folder> --config <splatting config file>
If you want to evaluate our pre-trained models, you have to download the source datsets and indicate their location to render.py
, just as done here:
python render.py -m <path to pre-trained model> -s <path to COLMAP dataset>
Alternatively, you can modify the source_path
with the cfg_args
-file and manually insert the correct path.
Note: We included our models for StopThePop and 3DGS, which were used in our evaluation: to minimize file size, we only include the final checkpoint. We also include the final, rendered images, hence you can reproduce our results easily.
Deep Blending | Mip-NeRF 360 Indoor | Mip-NeRF 360 Outdoor | Tanks & Temples | |||||||||||||
PSNR | SSIM | LPIPS | ꟻLIP | PSNR | SSIM | LPIPS | ꟻLIP | PSNR | SSIM | LPIPS | ꟻLIP | PSNR | SSIM | LPIPS | ꟻLIP | |
Ours | 29.86 | 0.904 | 0.234 | 0.127 | 30.62 | 0.921 | 0.186 | 0.099 | 24.60 | 0.728 | 0.235 | 0.167 | 23.21 | 0.843 | 0.173 | 0.216 |
3DGS | 29.46 | 0.900 | 0.247 | 0.131 | 30.98 | 0.922 | 0.189 | 0.094 | 24.59 | 0.727 | 0.240 | 0.167 | 23.71 | 0.845 | 0.178 | 0.199 |
New Command Line Arguments for full_eval.py
Train with Opacity Decay - this results in comparable image metrics with significantly fewer Gaussians. We used --opacity_decay 0.9995
for the reported results in our paper.
Original Command Line Arguments for full_eval.py
Flag to skip training stage.
Flag to skip rendering stage.
Flag to skip metrics calculation stage.
Directory to put renderings and results in, ./eval
by default, set to pre-trained model location if evaluating them.
Path to MipNeRF360 source datasets, required if training or rendering.
Path to Tanks&Temples source datasets, required if training or rendering.
Path to Deep Blending source datasets, required if training or rendering.
Our proposed optimization imply a significant performance improvement, even for vanilla 3DGS. Here is a framerate comparison for two exemplary scenes in Full HD resolution, run on an NVIDIA RTX 4090 with CUDA 11.8.
Bicycle | Train | |||
3DGS | Ours | 3DGS | Ours | |
Vanilla | 90 | 20 | 159 | 43 |
w/ Rect Culling | 168 | 42 | 277 | 81 |
w/ Opacity Culling | 205 | 54 | 341 | 97 |
w/ Load Balancing | 216 | 61 | 360 | 120 |
w/ Tile-based Culling | 240 | 76 | 425 | 145 |
w/ 4x4 Tile Culling | - | 119 | - | 213 |
Note: For 3DGS, 4x4 Tile Culling is not an option.
Following 3DGS, we provide interactive viewers for our method: remote and real-time.
Our viewing solutions are based on the SIBR framework, developed by the GRAPHDECO group for several novel-view synthesis projects.
Our modified viewer contains additional debug modes, and options to disable several of our proposed optimizations.
The settings on startup are based on the config.json
file in the model directory (if it exists).
The implementation is hosted here.
Hardware requirements and setup steps are identical to 3DGS, hence, refer to the corresponding README for details.
If you cloned with submodules (e.g., using --recursive
), the source code for the viewers is found in SIBR_viewers
.
CMake should take care of your dependencies.
cd SIBR_viewers
cmake -Bbuild .
cmake --build build --target install --config RelWithDebInfo
You may specify a different configuration, e.g. Debug
if you need more control during development.
You will need to install a few dependencies before running the project setup.
# Dependencies
sudo apt install -y libglew-dev libassimp-dev libboost-all-dev libgtk-3-dev libopencv-dev libglfw3-dev libavdevice-dev libavcodec-dev libeigen3-dev libxxf86vm-dev libembree-dev
# Project setup
cd SIBR_viewers
cmake -Bbuild . -DCMAKE_BUILD_TYPE=Release # add -G Ninja to build faster
cmake --build build -j24 --target install
For performance reasons, we use templates for several of our options, causing very long compile times for our submodule and SIBR.
Hence, we provide a STOPTHEPOP_FASTBUILD
option in submodules/diff-gaussian-rasterization/cuda_rasterizer/rasterizer.h
.
Simply uncomment
// #define STOPTHEPOP_FASTBUILD
This solely compiles the default options for our method, which should be sufficient.
If you further want to reduce the compile time, simply specify the exact CUDA_ARCHITECTURE
in the submodules/diff-gaussian-rasterization/CMakeLists.txt
.
Note: For
SIBR
, the correspondingCMakeLists.txt
is located inSIBR_viewers/extlibs/CudaRasterizer/CudaRasterizer/CMakeLists.txt
, andrasterizer.h
is located inSIBR_viewers/extlibs/CudaRasterizer/CudaRasterizer/cuda_rasterizer/rasterizer.h
real-time-viewer-demo.mp4
@misc{sibr2020,
author = {Bonopera, Sebastien and Esnault, Jerome and Prakash, Siddhant and Rodriguez, Simon and Thonat, Theo and Benadel, Mehdi and Chaurasia, Gaurav and Philip, Julien and Drettakis, George},
title = {sibr: A System for Image Based Rendering},
year = {2020},
url = {https://gitlab.inria.fr/sibr/sibr_core}
}
Our popping detection method is a self-contained module, hosted here, and is included as a submodule.
For more information on how to run the method, consult the submodules README.
Please consider 3DGS's FAQ, contained in their README. In addition, several issues are also covered on 3DGS's issues page. We will update this FAQ as issues arise.