Coder Social home page Coder Social logo

graphdeco-inria / gaussian-splatting Goto Github PK

View Code? Open in Web Editor NEW
11.4K 103.0 1.4K 2.09 MB

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"

Home Page: https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/

License: Other

Python 100.00%
computer-graphics computer-vision radiance-field

gaussian-splatting's Introduction

3D Gaussian Splatting for Real-Time Radiance Field Rendering

Bernhard Kerbl*, Georgios Kopanas*, Thomas Leimkühler, George Drettakis (* indicates equal contribution)
| Webpage | Full Paper | Video | Other GRAPHDECO Publications | FUNGRAPH project page |
| T&T+DB COLMAP (650MB) | Pre-trained Models (14 GB) | Viewers for Windows (60MB) | Evaluation Images (7 GB) |
Teaser image

This repository contains the official authors implementation associated with the paper "3D Gaussian Splatting for Real-Time Radiance Field Rendering", which can be found here. We further provide the reference images used to create the error metrics reported in the paper, as well as recently created, pre-trained models.

Abstract: Radiance Field methods have recently revolutionized novel-view synthesis of scenes captured with multiple photos or videos. However, achieving high visual quality still requires neural networks that are costly to train and render, while recent faster methods inevitably trade off speed for quality. For unbounded and complete scenes (rather than isolated objects) and 1080p resolution rendering, no current method can achieve real-time display rates. We introduce three key elements that allow us to achieve state-of-the-art visual quality while maintaining competitive training times and importantly allow high-quality real-time (≥ 30 fps) novel-view synthesis at 1080p resolution. First, starting from sparse points produced during camera calibration, we represent the scene with 3D Gaussians that preserve desirable properties of continuous volumetric radiance fields for scene optimization while avoiding unnecessary computation in empty space; Second, we perform interleaved optimization/density control of the 3D Gaussians, notably optimizing anisotropic covariance to achieve an accurate representation of the scene; Third, we develop a fast visibility-aware rendering algorithm that supports anisotropic splatting and both accelerates training and allows realtime rendering. We demonstrate state-of-the-art visual quality and real-time rendering on several established datasets.

BibTeX

@Article{kerbl3Dgaussians,
      author       = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\"u}hler, Thomas and Drettakis, George},
      title        = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},
      journal      = {ACM Transactions on Graphics},
      number       = {4},
      volume       = {42},
      month        = {July},
      year         = {2023},
      url          = {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}
}

Funding and Acknowledgments

This research was funded by the ERC Advanced grant FUNGRAPH No 788065. The authors are grateful to Adobe for generous donations, the OPAL infrastructure from Université Côte d’Azur and for the HPC resources from GENCI–IDRIS (Grant 2022-AD011013409). The authors thank the anonymous reviewers for their valuable feedback, P. Hedman and A. Tewari for proofreading earlier drafts also T. Müller, A. Yu and S. Fridovich-Keil for helping with the comparisons.

Step-by-step Tutorial

Jonathan Stephens made a fantastic step-by-step tutorial for setting up Gaussian Splatting on your machine, along with instructions for creating usable datasets from videos. If the instructions below are too dry for you, go ahead and check it out here.

Colab

User camenduru was kind enough to provide a Colab template that uses this repo's source (status: August 2023!) for quick and easy access to the method. Please check it out here.

Cloning the Repository

The repository contains submodules, thus please check it out with

# SSH
git clone [email protected]:graphdeco-inria/gaussian-splatting.git --recursive

or

# HTTPS
git clone https://github.com/graphdeco-inria/gaussian-splatting --recursive

Overview

The codebase has 4 main components:

  • A PyTorch-based optimizer to produce a 3D Gaussian model from SfM inputs
  • A network viewer that allows to connect to and visualize the optimization process
  • An OpenGL-based real-time viewer to render trained models in real-time.
  • A script to help you turn your own images into optimization-ready SfM data sets

The components have different requirements w.r.t. both hardware and software. They have been tested on Windows 10 and Ubuntu Linux 22.04. Instructions for setting up and running each of them are found in the sections below.

New features [Please check regularly!]

We will be adding several new features soon. In the meantime Orange has kindly added OpenXR support for VR viewing. Please come back soon, we will be adding other features, building among others on recent 3DGS followup papers.

Optimizer

The optimizer uses PyTorch and CUDA extensions in a Python environment to produce trained models.

Hardware Requirements

  • CUDA-ready GPU with Compute Capability 7.0+
  • 24 GB VRAM (to train to paper evaluation quality)
  • Please see FAQ for smaller VRAM configurations

Software Requirements

  • Conda (recommended for easy setup)
  • C++ Compiler for PyTorch extensions (we used Visual Studio 2019 for Windows)
  • CUDA SDK 11 for PyTorch extensions, install after Visual Studio (we used 11.8, known issues with 11.6)
  • C++ Compiler and CUDA SDK must be compatible

Setup

Local Setup

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 gaussian_splatting

Please note that this process assumes that you have CUDA SDK 11 installed, not 12. For modifications, see below.

Tip: Downloading packages and creating a new environment with Conda can require a significant amount of disk space. By default, Conda will use the main system hard drive. You can avoid this by specifying a different package download location and an environment on a different drive:

conda config --add pkgs_dirs <Drive>/<pkg_path>
conda env create --file environment.yml --prefix <Drive>/<env_path>/gaussian_splatting
conda activate <Drive>/<env_path>/gaussian_splatting

Modifications

If you can afford the disk space, we recommend using our environment files for setting up a training environment identical to ours. If you want to make modifications, please note that major version changes might affect the results of our method. However, our (limited) experiments suggest that the codebase works just fine inside a more up-to-date environment (Python 3.8, PyTorch 2.0.0, CUDA 12). Make sure to create an environment where PyTorch and its CUDA runtime version match and the installed CUDA SDK has no major version difference with PyTorch's CUDA version.

Known Issues

Some users experience problems building the submodules on Windows (cl.exe: File not found or similar). Please consider the workaround for this problem from the FAQ.

Running

To run the optimizer, simply use

python train.py -s <path to COLMAP or NeRF Synthetic dataset>
Command Line Arguments for train.py

--source_path / -s

Path to the source directory containing a COLMAP or Synthetic NeRF data set.

--model_path / -m

Path where the trained model should be stored (output/<random> by default).

--images / -i

Alternative subdirectory for COLMAP images (images by default).

--eval

Add this flag to use a MipNeRF360-style training/test split for evaluation.

--resolution / -r

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.

--data_device

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.

--white_background / -w

Add this flag to use white background instead of black (default), e.g., for evaluation of NeRF Synthetic dataset.

--sh_degree

Order of spherical harmonics to be used (no larger than 3). 3 by default.

--convert_SHs_python

Flag to make pipeline compute forward and backward of SHs with PyTorch instead of ours.

--convert_cov3D_python

Flag to make pipeline compute forward and backward of the 3D covariance with PyTorch instead of ours.

--debug

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.

--debug_from

Debugging is slow. You may specify an iteration (starting from 0) after which the above debugging becomes active.

--iterations

Number of total iterations to train for, 30_000 by default.

--ip

IP to start GUI server on, 127.0.0.1 by default.

--port

Port to use for GUI server, 6009 by default.

--test_iterations

Space-separated iterations at which the training script computes L1 and PSNR over test set, 7000 30000 by default.

--save_iterations

Space-separated iterations at which the training script saves the Gaussian model, 7000 30000 <iterations> by default.

--checkpoint_iterations

Space-separated iterations at which to store a checkpoint for continuing later, saved in the model directory.

--start_checkpoint

Path to a saved checkpoint to continue training from.

--quiet

Flag to omit any text written to standard out pipe.

--feature_lr

Spherical harmonics features learning rate, 0.0025 by default.

--opacity_lr

Opacity learning rate, 0.05 by default.

--scaling_lr

Scaling learning rate, 0.005 by default.

--rotation_lr

Rotation learning rate, 0.001 by default.

--position_lr_max_steps

Number of steps (from 0) where position learning rate goes from initial to final. 30_000 by default.

--position_lr_init

Initial 3D position learning rate, 0.00016 by default.

--position_lr_final

Final 3D position learning rate, 0.0000016 by default.

--position_lr_delay_mult

Position learning rate multiplier (cf. Plenoxels), 0.01 by default.

--densify_from_iter

Iteration where densification starts, 500 by default.

--densify_until_iter

Iteration where densification stops, 15_000 by default.

--densify_grad_threshold

Limit that decides if points should be densified based on 2D position gradient, 0.0002 by default.

--densification_interval

How frequently to densify, 100 (every 100 iterations) by default.

--opacity_reset_interval

How frequently to reset opacity, 3_000 by default.

--lambda_dssim

Influence of SSIM on total loss from 0 to 1, 0.2 by default.

--percent_dense

Percentage of scene extent (0--1) a point must exceed to be forcibly densified, 0.01 by default.


Note that similar to MipNeRF360, we target images at resolutions in the 1-1.6K pixel range. For convenience, arbitrary-size inputs can be passed and will be automatically resized if their width exceeds 1600 pixels. We recommend to keep this behavior, but you may force training to use your higher-resolution images by setting -r 1.

The MipNeRF360 scenes are hosted by the paper authors here. You can find our SfM data sets for Tanks&Temples and Deep Blending here. If you do not provide an output model directory (-m), trained models are written to folders with randomized unique names inside the output directory. At this point, the trained models may be viewed with the real-time viewer (see further below).

Evaluation

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
python metrics.py -m <path to trained model> # Compute error metrics on renderings

If you want to evaluate our pre-trained models, you will have to download the corresponding source data sets and indicate their location to render.py with an additional --source_path/-s flag. Note: The pre-trained models were created with the release codebase. This code base has been cleaned up and includes bugfixes, hence the metrics you get from evaluating them will differ from those in the paper.

python render.py -m <path to pre-trained model> -s <path to COLMAP dataset>
python metrics.py -m <path to pre-trained model>
Command Line Arguments for render.py

--model_path / -m

Path to the trained model directory you want to create renderings for.

--skip_train

Flag to skip rendering the training set.

--skip_test

Flag to skip rendering the test set.

--quiet

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.

--source_path / -s

Path to the source directory containing a COLMAP or Synthetic NeRF data set.

--images / -i

Alternative subdirectory for COLMAP images (images by default).

--eval

Add this flag to use a MipNeRF360-style training/test split for evaluation.

--resolution / -r

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.

--white_background / -w

Add this flag to use white background instead of black (default), e.g., for evaluation of NeRF Synthetic dataset.

--convert_SHs_python

Flag to make pipeline render with computed SHs from PyTorch instead of ours.

--convert_cov3D_python

Flag to make pipeline render with computed 3D covariance from PyTorch instead of ours.

Command Line Arguments for metrics.py

--model_paths / -m

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>

In the current version, this process takes about 7h on our reference machine containing an A6000. If you want to do the full evaluation on our pre-trained models, you can specify their download location and skip training.

python full_eval.py -o <directory with pretrained models> --skip_training -m360 <mipnerf360 folder> -tat <tanks and temples folder> -db <deep blending folder>

If you want to compute the metrics on our paper's evaluation images, you can also skip rendering. In this case it is not necessary to provide the source datasets. You can compute metrics for multiple image sets at a time.

python full_eval.py -m <directory with evaluation images>/garden ... --skip_training --skip_rendering
Command Line Arguments for full_eval.py

--skip_training

Flag to skip training stage.

--skip_rendering

Flag to skip rendering stage.

--skip_metrics

Flag to skip metrics calculation stage.

--output_path

Directory to put renderings and results in, ./eval by default, set to pre-trained model location if evaluating them.

--mipnerf360 / -m360

Path to MipNeRF360 source datasets, required if training or rendering.

--tanksandtemples / -tat

Path to Tanks&Temples source datasets, required if training or rendering.

--deepblending / -db

Path to Deep Blending source datasets, required if training or rendering.


Interactive Viewers

We provide two 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.

Hardware Requirements

  • OpenGL 4.5-ready GPU and drivers (or latest MESA software)
  • 4 GB VRAM recommended
  • CUDA-ready GPU with Compute Capability 7.0+ (only for Real-Time Viewer)

Software Requirements

  • Visual Studio or g++, not Clang (we used Visual Studio 2019 for Windows)
  • CUDA SDK 11, install after Visual Studio (we used 11.8)
  • CMake (recent version, we used 3.24)
  • 7zip (only on Windows)

Pre-built Windows Binaries

We provide pre-built binaries for Windows here. We recommend using them on Windows for an efficient setup, since the building of SIBR involves several external dependencies that must be downloaded and compiled on-the-fly.

Installation from Source

If you cloned with submodules (e.g., using --recursive), the source code for the viewers is found in SIBR_viewers. The network viewer runs within the SIBR framework for Image-based Rendering applications.

Windows

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.

Ubuntu 22.04

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

Ubuntu 20.04

Backwards compatibility with Focal Fossa is not fully tested, but building SIBR with CMake should still work after invoking

git checkout fossa_compatibility

Navigation in SIBR Viewers

The SIBR interface provides several methods of navigating the scene. By default, you will be started with an FPS navigator, which you can control with W, A, S, D, Q, E for camera translation and I, K, J, L, U, O for rotation. Alternatively, you may want to use a Trackball-style navigator (select from the floating menu). You can also snap to a camera from the data set with the Snap to button or find the closest camera with Snap to closest. The floating menues also allow you to change the navigation speed. You can use the Scaling Modifier to control the size of the displayed Gaussians, or show the initial point cloud.

Running the Network Viewer

remoteviewer.mp4

After extracting or installing the viewers, you may run the compiled SIBR_remoteGaussian_app[_config] app in <SIBR install dir>/bin, e.g.:

./<SIBR install dir>/bin/SIBR_remoteGaussian_app

The network viewer allows you to connect to a running training process on the same or a different machine. If you are training on the same machine and OS, no command line parameters should be required: the optimizer communicates the location of the training data to the network viewer. By default, optimizer and network viewer will try to establish a connection on localhost on port 6009. You can change this behavior by providing matching --ip and --port parameters to both the optimizer and the network viewer. If for some reason the path used by the optimizer to find the training data is not reachable by the network viewer (e.g., due to them running on different (virtual) machines), you may specify an override location to the viewer by using -s <source path>.

Primary Command Line Arguments for Network Viewer

--path / -s

Argument to override model's path to source dataset.

--ip

IP to use for connection to a running training script.

--port

Port to use for connection to a running training script.

--rendering-size

Takes two space separated numbers to define the resolution at which network rendering occurs, 1200 width by default. Note that to enforce an aspect that differs from the input images, you need --force-aspect-ratio too.

--load_images

Flag to load source dataset images to be displayed in the top view for each camera.


Running the Real-Time Viewer

realtimeviewer.mp4

After extracting or installing the viewers, you may run the compiled SIBR_gaussianViewer_app[_config] app in <SIBR install dir>/bin, e.g.:

./<SIBR install dir>/bin/SIBR_gaussianViewer_app -m <path to trained model>

It should suffice to provide the -m parameter pointing to a trained model directory. Alternatively, you can specify an override location for training input data using -s. To use a specific resolution other than the auto-chosen one, specify --rendering-size <width> <height>. Combine it with --force-aspect-ratio if you want the exact resolution and don't mind image distortion.

To unlock the full frame rate, please disable V-Sync on your machine and also in the application (Menu → Display). In a multi-GPU system (e.g., laptop) your OpenGL/Display GPU should be the same as your CUDA GPU (e.g., by setting the application's GPU preference on Windows, see below) for maximum performance.

Teaser image

In addition to the initial point cloud and the splats, you also have the option to visualize the Gaussians by rendering them as ellipsoids from the floating menu. SIBR has many other functionalities, please see the documentation for more details on the viewer, navigation options etc. There is also a Top View (available from the menu) that shows the placement of the input cameras and the original SfM point cloud; please note that Top View slows rendering when enabled. The real-time viewer also uses slightly more aggressive, fast culling, which can be toggled in the floating menu. If you ever encounter an issue that can be solved by turning fast culling off, please let us know.

Primary Command Line Arguments for Real-Time Viewer

--model-path / -m

Path to trained model.

--iteration

Specifies which of state to load if multiple are available. Defaults to latest available iteration.

--path / -s

Argument to override model's path to source dataset.

--rendering-size

Takes two space separated numbers to define the resolution at which real-time rendering occurs, 1200 width by default. Note that to enforce an aspect that differs from the input images, you need --force-aspect-ratio too.

--load_images

Flag to load source dataset images to be displayed in the top view for each camera.

--device

Index of CUDA device to use for rasterization if multiple are available, 0 by default.

--no_interop

Disables CUDA/GL interop forcibly. Use on systems that may not behave according to spec (e.g., WSL2 with MESA GL 4.5 software rendering).


Processing your own Scenes

Our COLMAP loaders expect the following dataset structure in the source path location:

<location>
|---images
|   |---<image 0>
|   |---<image 1>
|   |---...
|---sparse
    |---0
        |---cameras.bin
        |---images.bin
        |---points3D.bin

For rasterization, the camera models must be either a SIMPLE_PINHOLE or PINHOLE camera. We provide a converter script convert.py, to extract undistorted images and SfM information from input images. Optionally, you can use ImageMagick to resize the undistorted images. This rescaling is similar to MipNeRF360, i.e., it creates images with 1/2, 1/4 and 1/8 the original resolution in corresponding folders. To use them, please first install a recent version of COLMAP (ideally CUDA-powered) and ImageMagick. Put the images you want to use in a directory <location>/input.

<location>
|---input
    |---<image 0>
    |---<image 1>
    |---...

If you have COLMAP and ImageMagick on your system path, you can simply run

python convert.py -s <location> [--resize] #If not resizing, ImageMagick is not needed

Alternatively, you can use the optional parameters --colmap_executable and --magick_executable to point to the respective paths. Please note that on Windows, the executable should point to the COLMAP .bat file that takes care of setting the execution environment. Once done, <location> will contain the expected COLMAP data set structure with undistorted, resized input images, in addition to your original images and some temporary (distorted) data in the directory distorted.

If you have your own COLMAP dataset without undistortion (e.g., using OPENCV camera), you can try to just run the last part of the script: Put the images in input and the COLMAP info in a subdirectory distorted:

<location>
|---input
|   |---<image 0>
|   |---<image 1>
|   |---...
|---distorted
    |---database.db
    |---sparse
        |---0
            |---...

Then run

python convert.py -s <location> --skip_matching [--resize] #If not resizing, ImageMagick is not needed
Command Line Arguments for convert.py

--no_gpu

Flag to avoid using GPU in COLMAP.

--skip_matching

Flag to indicate that COLMAP info is available for images.

--source_path / -s

Location of the inputs.

--camera

Which camera model to use for the early matching steps, OPENCV by default.

--resize

Flag for creating resized versions of input images.

--colmap_executable

Path to the COLMAP executable (.bat on Windows).

--magick_executable

Path to the ImageMagick executable.


OpenXR support

OpenXR is supported in the branch gaussian_code_release_openxr Within that branch, you can find documentation for VR support here.

FAQ

  • Where do I get data sets, e.g., those referenced in full_eval.py? The MipNeRF360 data set is provided by the authors of the original paper on the project site. Note that two of the data sets cannot be openly shared and require you to consult the authors directly. For Tanks&Temples and Deep Blending, please use the download links provided at the top of the page. Alternatively, you may access the cloned data (status: August 2023!) from HuggingFace

  • How can I use this for a much larger dataset, like a city district? The current method was not designed for these, but given enough memory, it should work out. However, the approach can struggle in multi-scale detail scenes (extreme close-ups, mixed with far-away shots). This is usually the case in, e.g., driving data sets (cars close up, buildings far away). For such scenes, you can lower the --position_lr_init, --position_lr_final and --scaling_lr (x0.3, x0.1, ...). The more extensive the scene, the lower these values should be. Below, we use default learning rates (left) and --position_lr_init 0.000016 --scaling_lr 0.001" (right).

Default learning rate result Reduced learning rate result
  • I'm on Windows and I can't manage to build the submodules, what do I do? Consider following the steps in the excellent video tutorial here, hopefully they should help. The order in which the steps are done is important! Alternatively, consider using the linked Colab template.

  • It still doesn't work. It says something about cl.exe. What do I do? User Henry Pearce found a workaround. You can you try adding the visual studio path to your environment variables (your version number might differ); C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 Then make sure you start a new conda prompt and cd to your repo location and try this;

conda activate gaussian_splatting
cd <dir_to_repo>/gaussian-splatting
pip install submodules\diff-gaussian-rasterization
pip install submodules\simple-knn
  • I'm on macOS/Puppy Linux/Greenhat and I can't manage to build, what do I do? Sorry, we can't provide support for platforms outside of the ones we list in this README. Consider using the linked Colab template.

  • I don't have 24 GB of VRAM for training, what do I do? The VRAM consumption is determined by the number of points that are being optimized, which increases over time. If you only want to train to 7k iterations, you will need significantly less. To do the full training routine and avoid running out of memory, you can increase the --densify_grad_threshold, --densification_interval or reduce the value of --densify_until_iter. Note however that this will affect the quality of the result. Also try setting --test_iterations to -1 to avoid memory spikes during testing. If --densify_grad_threshold is very high, no densification should occur and training should complete if the scene itself loads successfully.

  • 24 GB of VRAM for reference quality training is still a lot! Can't we do it with less? Yes, most likely. By our calculations it should be possible with way less memory (~8GB). If we can find the time we will try to achieve this. If some PyTorch veteran out there wants to tackle this, we look forward to your pull request!

  • How can I use the differentiable Gaussian rasterizer for my own project? Easy, it is included in this repo as a submodule diff-gaussian-rasterization. Feel free to check out and install the package. It's not really documented, but using it from the Python side is very straightforward (cf. gaussian_renderer/__init__.py).

  • Wait, but <insert feature> isn't optimized and could be much better? There are several parts we didn't even have time to think about improving (yet). The performance you get with this prototype is probably a rather slow baseline for what is physically possible.

  • Something is broken, how did this happen? We tried hard to provide a solid and comprehensible basis to make use of the paper's method. We have refactored the code quite a bit, but we have limited capacity to test all possible usage scenarios. Thus, if part of the website, the code or the performance is lacking, please create an issue. If we find the time, we will do our best to address it.

gaussian-splatting's People

Contributors

eltociear avatar emepetres avatar gdrett avatar graphdeco avatar hrspythonix avatar jakubcerveny avatar jonathonluiten avatar khoa-nt avatar snosixtyboo avatar szymanowiczs avatar yzslab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaussian-splatting's Issues

remote viewer cannot find the model path

I use SIBR remote viewer to connect to remote training server, and training server indicates the viewer is connected but the viewer app cannot find the model path, even i use --path to give the right model path in training server

could you please explain the following instructions, and that would be better if you can give me an example.

due to them running on different (virtual) machines), you may specify an override location to the viewer by using -s

Thanks

Point Cloud Seems super noisy

image

the red part is the only valid part, the rest seems out side of camera. In my opinion, your method shoud produce a more valid pointcloud since using splatting as rendering method?

Any idea how to generate a more valid point cloud in future work?

RuntimeError: CUDA error: an illegal memory access was encountered

Hello, I was surprised by your work and tried to reproduce it with the code you've provided.
However, every time I tried to run the code, it always failed to run with the runtime error i mentioned on the title.

Traceback (most recent call last):
File "train.py", line 213, in
training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations, args.checkpoint_iterations, args.start_checkpoint)
File "train.py", line 87, in training
loss = (1.0 - opt.lambda_dssim) * Ll1 + opt.lambda_dssim * (1.0 - ssim(image, gt_image))
File "/home/seohoiki/Research/NeRF/gaussian-splatting/utils/loss_utils.py", line 38, in ssim
window = window.cuda(img1.get_device())
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Training progress: 0%| | 0/30000 [00:00<?, ?it/s]

I tried all the methods you've told in other issues, but failed.
My system & settings:
RTX4090
Ubuntu 22.04 LTS
Exact environment with given .yml file

Strangely, my colleague who has system with RTX 3090 / Ubuntu 20.04 runs the code without any problem.(Except them, all the settings are exactly the same including CUDA SDK version)

I hope I can get some solution for this problem!

Thank you.

=====================================
Results with cuda-memcheck

========= CUDA-MEMCHECK
========= This tool is deprecated and will be removed in a future release of the CUDA toolkit
========= Please use the compute-sanitizer tool as a drop-in replacement
Optimizing
Output folder: ./output/54877260-0 [17/07 19:21:51]
Tensorboard not available: not logging progress [17/07 19:21:51]
Found transforms_train.json file, assuming Blender data set! [17/07 19:21:51]
Reading Training Transforms [17/07 19:21:51]
Reading Test Transforms [17/07 19:21:53]
Loading Training Cameras [17/07 19:21:56]
Loading Test Cameras [17/07 19:21:57]
Number of points at initialisation : 100000 [17/07 19:21:57]
Training progress: 0%| | 0/30000 [00:00<?, ?it/s]Traceback (most recent call last):
File "train.py", line 213, in
training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations, args.checkpoint_iterations, args.start_checkpoint)
File "train.py", line 87, in training
loss = (1.0 - opt.lambda_dssim) * Ll1 + opt.lambda_dssim * (1.0 - ssim(image, gt_image))
File "/home/seohoiki/Research/NeRF/gaussian-splatting/utils/loss_utils.py", line 38, in ssim
window = window.cuda(img1.get_device())
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Training progress: 0%| | 0/30000 [00:00<?, ?it/s]
========= ERROR SUMMARY: 0 errors

SIBR installation failed at linking texturedMesh_app

Hey, thanks a lot for releasing the code for such an outstanding paper! Couldn't wait to try it out on my data.

Unfortunately, I bumped into this:

Environment

  • Ubuntu 20.04
  • GCC 9.4.0
  • nvcc V11.8.89
  • cmake 3.25.0
  • Followed installation instructions from readme (installed libs for ubuntu, checked out git branch)

Anyway, maybe anyone has any idea how to fix the following problem during the compilation of SIBR?

[ 89%] Linking CXX executable SIBR_texturedMesh_app
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_set_do_overwrite_confirmation'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_main_iteration'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_widget_destroy'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_dialog_run'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_set_select_multiple'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_set_current_folder'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_add_filter'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_filter_new'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_get_filenames'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_dialog_get_type'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_filter_add_pattern'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_get_type'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_get_filename'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_init_check'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_filter_set_name'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_events_pending'
/usr/bin/ld: ../../../../core/system/libsibr_system.so: undefined reference to `gtk_file_chooser_dialog_new'
collect2: error: ld returned 1 exit status
make[2]: *** [src/projects/basic/apps/texturedMesh/CMakeFiles/SIBR_texturedMesh_app.dir/build.make:202: src/projects/basic/apps/texturedMesh/SIBR_texturedMesh_app] Error 1
make[1]: *** [CMakeFiles/Makefile2:1335: src/projects/basic/apps/texturedMesh/CMakeFiles/SIBR_texturedMesh_app.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The thing is, I have libgtk3-dev correctly installed
dpkg -l libgtk-3-dev

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name               Version            Architecture Description
+++-==================-==================-============-=====================================
ii  libgtk-3-dev:amd64 3.24.20-0ubuntu1.1 amd64        development files for the GTK library

and cmake also finds it during configuration:

-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.24.20

CUDA error while running

Hi,
Thanks a lot for sharing your great work. I've built the environment properly and while running the tanks and temples dataset, getting following error:

Training progress: 0%| | 0/30000 [00:00<?, ?it/s]Traceback (most recent call last):
File "train.py", line 204, in
training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations)
File "train.py", line 81, in training
loss = (1.0 - opt.lambda_dssim) * Ll1 + opt.lambda_dssim * (1.0 - ssim(image, gt_image))
File "/media/sdc/merf_research/gaussian_mixture/gaussian-splatting/utils/loss_utils.py", line 38, in ssim
window = window.cuda(img1.get_device())
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Any idea how to resolve? My environment matches exactly with your repo

Prebuilt Windows viewer did not work after updating to the latest version

I used viewer downloaded in 07/12, I all worked fine. After downloading the latest version of viewer yesterday, the viewer just could not open the scene (a blank viewer pop out and disappear after a while). The logs are pasted below, I am using RTX2080, any idea what could cause this?

CMD:

.\bin\SIBR_gaussianViewer_app.exe -m .\gaussian-splatting\output\shop\ -s .\gs_dataset\dataset\shop\ --rendering-size 1920 1080

latest:

[SIBR] --  INFOS  --:   Initialization of GLFW
[SIBR] --  INFOS  --:   OpenGL Version: 4.6.0 NVIDIA 516.59[major: 4, minor: 6]

previous:

[SIBR] --  INFOS  --:   Initialization of GLFW
[SIBR] --  INFOS  --:   OpenGL Version: 4.6.0 NVIDIA 516.59[major: 4, minor: 6]
Number of input Images to read: 802
Number of Cameras set up: 802
LOADSFM: Try to open D:\workspace\SotaNeRFs\gs_dataset\dataset\shop_800\/sparse/0/points3D.bin
Num 3D pts 99869
[SIBR] --  INFOS  --:   SfM Mesh 'D:\workspace\SotaNeRFs\gs_dataset\dataset\shop_800\/sparse/0/points3d.bin successfully loaded.  (99869) vertices detected. Init GL ...
[SIBR] --  INFOS  --:   Init GL mesh complete
[SIBR] --  INFOS  --:   Loading 1193241 Gaussian splats
[SIBR] --  INFOS  --:   Initializing Raycaster
[SIBR] --  INFOS  --:   Interactive camera using (0.009,1100) near/far planes.
Switched to trackball mode.
[SIBR] --  INFOS  --:   Deinitialization of GLFW

How to save density png sequence?

Hi! I'm wondering if I can save density png sequence from the render process?

Something like this:
20230713-101507

this is the conventional fox scene exported from instant ngp.exe

Edit/clean a trained .ply file ?

Hi, is it possible to edit the noise and floaters from the trained .ply file?

I have opened the file in CloudCompare and can see that there are many headers with layers of information. Is there a way to edit the clouds in one go, crop them to a bounding box and save them back to the trained file type?

The subject in the bounding box is what I would like to crop to, as you can see there are a lot of floaters way out of the main scene area.

image

Alternatively, is there a way to constrain the splatting much closer to the input point cloud? I have tried swapping out the input cloud to one that has been edited so that just the subject is isolated but training still creates noise and floaters outside of this area, is this expected? We would also prefer to avoid masking.

And finally, is there an aabb_crop in the viewer it self, so the noise is still in the file but not rendered?

Known issues with Cuda tool kit 11.6 ?

In the software requirements of the setup is says;

CUDA SDK 11 for PyTorch extensions (we used 11.8, known issues with 11.6)

yet in the environment.yml is says;

dependencies:

  • cudatoolkit=11.6

can some one explain this please?

Can you explain more about binning in rasterizer?

Hi, the work is great! I'm trying to migrate the Algorithm to some other platform.
During reading your code, I notice that you implement a GPU memory pool in your rasterizer and use an alignment of 128. I'm curious about the idea behind this design decision. I'm wondering if the GPU memory pool help. Is there any data point/experiment result comparing using/not using the GPU memory pool?

Thanks!

Loading viewer iteration not working

Hi I'm using the windows Viewer and this command;

C:/gaussian-splatting/SIBR_viewers_win/bin/SIBR_gaussianViewer_app.exe -m C:/gaussian-splatting/output/truck --iteration 7000

And getting the error;

[SIBR] --  INFOS  --:   Initialization of GLFW
[SIBR] --  INFOS  --:   OpenGL Version: 4.6.0 NVIDIA 528.95[major: 4, minor: 6]
Number of input Images to read: 59
Number of Cameras set up: 59
LOADSFM: Try to open C:\\gaussian-splatting\\data\\truck/sparse/0/points3D.bin
Num 3D pts 47989
[SIBR] --  INFOS  --:   SfM Mesh 'C:\\gaussian-splatting\\data\\truck/sparse/0/points3d.bin successfully loaded.  (47989) vertices detected. Init GL ...
[SIBR] --  INFOS  --:   Init GL mesh complete
[SIBR] ##  ERROR  ##:   FILE C:\projects\gauss2\SIBR_viewers\src\projects\gaussianviewer\renderer\GaussianView.cpp
                        LINE 75, FUNC loadPly
                        Unable to find model's PLY file, attempted:
C:/gaussian-splatting/output/truck/point_cloud/iteration_7000 / point_cloud.ply

It looks like it is referencing where the project was created C:\projects\gauss2\SIBR_viewers Does it need compiling a different way so it doesn't need to reference these files?

PyTorch model code release

Thank you very much for releasing the source code!

I see that the model is fully implemented in CUDA. However, for experimentation purposes, pure PyTorch implementation would be better.

Is there a plan to release the PyTorch model implementation?

Thank you!

Error message"Colmap camera model not handled!"

Error message;

(gaussian_splatting) C:\gaussian-splatting>python train.py -s C:\gaussian-splatting\data\test
Optimizing
Output folder: ./output/15709e19-a [10/07 13:19:45]
Tensorboard not available: not logging progress [10/07 13:19:45]
Reading camera 1/31Traceback (most recent call last):
  File "train.py", line 204, in <module>
    training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations)
  File "train.py", line 35, in training
    scene = Scene(dataset, gaussians)
  File "C:\gaussian-splatting\scene\__init__.py", line 44, in __init__
    scene_info = sceneLoadTypeCallbacks["Colmap"](args.source_path, args.images, args.eval)
  File "C:\gaussian-splatting\scene\dataset_readers.py", line 145, in readColmapSceneInfo
    cam_infos_unsorted = readColmapCameras(cam_extrinsics=cam_extrinsics, cam_intrinsics=cam_intrinsics, images_folder=os.path.join(path, reading_dir))
  File "C:\gaussian-splatting\scene\dataset_readers.py", line 95, in readColmapCameras
    assert False, "Colmap camera model not handled!"
AssertionError: Colmap camera model not handled!

Not sure what to do here, its a camera with 24mm lens, colmap 3.8 aligned the 31 image loop fine, any suggestions?

Loss not going down and renders look bad

hi I'm running it like so:

python train.py --ip 0.0.0.0 --port 13379 -s $colmap -m $outdir
python render.py -m $outdir

The logs from train.py look like this:

Optimizing /home/danlu/debug/gaussian-splatting-2023-07-10
Output folder: /home/danlu/debug/gaussian-splatting-2023-07-10 [11/07 13:56:37]
Reading camera 1130/1130 [11/07 13:56:39]
Loading Training Cameras [11/07 13:56:39]
Loading Test Cameras [11/07 13:56:52]
Number of points at initialisation :  532404 [11/07 13:56:52]
Training progress:  23%|████████████████▌                                                      | 7000/30000 [01:45<04:24, 86.86it/s, Loss=0.2195082]
[ITER 7000] Evaluating train: L1 0.2186211347579956 PSNR 12.067031860351562 [11/07 13:58:39]

[ITER 7000] Saving Gaussians [11/07 13:58:39]
Training progress: 100%|█████████████████████████████████████████████████████████████████████▉| 30000/30000 [06:19<00:00, 78.99it/s, Loss=0.2308751]

[ITER 30000] Saving Gaussians [11/07 14:03:11]

Training complete. [11/07 14:03:13]

But the output looks very bad, almost all the frames in `$outdir/ are like this:

image

or like this:
image

and only a few frames (around 5 out of over 1000 frames) have any sort of recognizable structure in them.

image

On the other hand, using taichi gaussian splatting with the exact same dataset, the output looks very reasonable.

Does anyone have any ideas for the parameters that I might have to change?

Where is the culling ?

Hi ! Your work is truly amazing.
I have one question about the renderer, i would like to know where do you cull the 3D Gaussian on the tiles.
Thanks

simple-knn build failure

With CUDA 12.0 and pytorch 2.0, it seems that simple-knn has the following build failure:

/home/dllu/builds/gaussian-splatting/submodules/simple-knn/simple_knn.cu(196): error: namespace "thrust" has no member "sequence"

It seems it is likely that will fail on other versions of CUDA as well but I haven't tried...

This is fixed with the following change:

diff --git a/simple_knn.cu b/simple_knn.cu
index 4828d2b..f99fee4 100644
--- a/simple_knn.cu
+++ b/simple_knn.cu
@@ -8,6 +8,7 @@
 #include <vector>
 #include <cuda_runtime_api.h>
 #include <thrust/device_vector.h>
+#include <thrust/sequence.h>

 #define __CUDACC__
 #include <cooperative_groups.h>
@@ -207,4 +208,4 @@ void SimpleKNN::knn(int P, float3* points, float* meanDists)
        boxMeanDist << <num_boxes, BOX_SIZE >> > (P, points, indices_sorted.data().get(), boxes.data().get(), meanDists);

        cudaFree(result);
-}
\ No newline at end of file
+}

(malheureusement je ne sais pas comment créer un PR sur https://gitlab.inria.fr/bkerbl/simple-knn)

Python-based rasterization code

Hi,

Thanks for making a great contribution to the area. I am wondering do you have Python rasterization code, which is easier to read and redevelop. Thank you.

Question about `scene_extent`

Why is the scene_extent computed as the radius of camera center rather than for example something related to the initial pointcloud? In your implement, the cameras with the same trajectories but one set of camera facing inward and one set of cameras facing outward will have exactly the same scene_extent, but the former one may corresponds with a smaller scene.

Also the resulting scene_extent is used to scale up the position learning rate. I still quite not understand why the learning rate should be proportional to the radius of camera center.

Major visual quality change in newer code update?

Hi, I went through the setup of installing the code on new machine yesterday and have noticed the results now have a major drop in visual quality.

The test was the same dataset trained with the same settings, viewing the 7000 iteration.
My dataset is 59 source images at 3008 x 4112 and ran with the command -r 4

I tested copying my original gaussian-splatting project folder over to the new PC and ran the same training and the result was the same good quality as the original.

So my questions are;

  • How can I see what version of the code I am running on the original PC?
  • What changes have been made that might have caused this visual quality drop in the latest release?
  • If we know the changes and the cause of this, are there options to disable it or other settings for the quality to match the original?

Installing SIBR - cannot find correct version of OpenCV

I get the following error upon running "cmake -Bbuild ." while trying to install SIBR:

CMake Error at cmake/linux/dependencies.cmake:248 (find_package):
  Could not find a configuration file for package "OpenCV" that is compatible
  with requested version "4.5".

  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake, version: 4.2.0
    /lib/x86_64-linux-gnu/cmake/opencv4/OpenCVConfig.cmake, version: 4.2.0

Call Stack (most recent call first):
  cmake/linux/include_once.cmake:20 (include)
  src/CMakeLists.txt:46 (include_once)

I am not very familiar with cmake, so although I am sure there is a quick and easy fix, I am not able to easily find it.

RuntimeError: numel: integer multiplication overflow

During Training

anaconda3/envs/gaussian_splatting/lib/python3.7/site-packages/diff_gaussian_rasterization/__init__.py", line 78, in forward
    num_rendered, color, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args)
RuntimeError: numel: integer multiplication overflow
Training progress:  18%|██████████                                              | 17940/100000 [1:36:57<7:23:31,  3.08it/s, Loss=0.0742834]

Any idea how to solve this?

Just Help

HI, i'm trying to run the provided trained images that has been available.
but isn't clear to me what commands to run it. It's possible to just writes the steps to run the available on images.zip file?

Did something change in the 'point cloud init' in the last 24 hours?

Current render on initialization (without training) (13th 4pm):

image

PSNR: 17.6

whereas yesterday (12th) at 4.30pm, the same render at initialization (without training) looked like this:
image
PSNR: 24.6

Did anything change when I repulled things? I don't think I did anything to make this change.. (but maybe I did)?

RuntimeError: Sizes of tensors must match except in dimension 0

Tensorboard not available: not logging progress [13/07 01:10:31]
Reading camera 56/56 [13/07 01:10:31]
Loading Training Cameras [13/07 01:10:31]
Loading Test Cameras [13/07 01:11:08]
Number of points at initialisation :  26558 [13/07 01:11:08]
Training progress:  23%|█████████████████████▏                                                                     | 7000/30000 [09:00<34:06, 11.24it/s, Loss=0.0516592]Traceback (most recent call last):
  File "train.py", line 204, in <module>
    training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations)
  File "train.py", line 99, in training
    training_report(tb_writer, iteration, Ll1, loss, l1_loss, iter_start.elapsed_time(iter_end), testing_iterations, scene, render, (pipe, background))
  File "train.py", line 162, in training_report
    images = torch.cat((images, image.unsqueeze(0)), dim=0)
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 2588 but got size 2589 for tensor number 1 in the list.
Training progress:  23%|█████████████████████▏                                                                     | 7000/30000 [09:01<29:39, 12.93it/s, Loss=0.0516592]

Images are 56 of around 3451 x 5178, I tried running with the auto 1.6k scaling and also with -r 2 and still get same type of error

Render.py require a lot more VRAM than the SIBR viewer

Using the same model, it cost 6GB-16GB VRAM when use render.py to render on my A10 card. But on my 2080 card with only 8GB it can run the viewer smoothly. How could that happen?

Any idea to reduce the VRAM requirment when use render.py

RuntimeError: Storage size calculation overflowed with sizes=[-2139761793]

traceback (most recent call last):
  File "train.py", line 204, in <module>
    training(lp.extract(args), op.extract(args), pp.extract(args), args.test_iterations, args.save_iterations)
  File "train.py", line 75, in training
    render_pkg = render(viewpoint_cam, gaussians, pipe, background)
  File "C:\gaussian-splatting\gaussian_renderer\__init__.py", line 92, in render
    cov3D_precomp = cov3D_precomp)
  File "C:\Users\admin\.conda\envs\gaussian_splatting\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\admin\.conda\envs\gaussian_splatting\lib\site-packages\diff_gaussian_rasterization\__init__.py", line 194, in forward
    raster_settings,
  File "C:\Users\admin\.conda\envs\gaussian_splatting\lib\site-packages\diff_gaussian_rasterization\__init__.py", line 37, in rasterize_gaussians
    raster_settings,
  File "C:\Users\admin\.conda\envs\gaussian_splatting\lib\site-packages\diff_gaussian_rasterization\__init__.py", line 78, in forward
    num_rendered, color, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args)
RuntimeError: Storage size calculation overflowed with sizes=[-2139761793]
Training progress:  20%|████████                                | 6020/30000 [30:05<1:59:53,  3.33it/s, Loss=0.0507467]

Running 56 of 3450 x 5180 images with -r 1.
Using a6000 with 48gb, is there anyway to calculate the limit of whats possible to run to which iteration?

Render code?

Hi, thanks for making this code available, it works very well.

I am looking to port the rendering code into a game engine, can you please explain how the rendering works with your model?

Which parts of SIBR are used?

Thanks!

How to use fast culling in render.py

I saw fast culling option in SIBR_gaussianViewer_app.exe, it can speed up 2X the FPS in my scene (50fps -> 100fps), I wonder if I can also use this option in render.py?

Tank and Temple dataset

Hi,

Thanks for providing the source code;
As I can see inside the scene class, you can only load Blender and Colmap datasets. Do you have any code for loading the Tank and Temple dataset?

Thanks.

Restore the training

Hi,

Thanks for your work. I just want to know whether your code support the "restore from specific iteration steps"? For example, I have stored the point clould for 10K stpes. Now, I want to load this point cloud information and restore training from it. Does your code support this?

Thanks in advance.

Wired rendering results

If we move our views up and down, the color pattern will become strange. We could notice there is a plane seems like cut the whole scene half. The color becomes normal when our camera pose was reset to training view poses.
动画1-min
This phenomenon happens globally. This plane is located at certain height.
动画2-min
Besides, we noticed when rendering the initial point clouds, some points are disappeared when the camera moves up and down.
动画4-min
I am wandering if the issues were connected to raster? Are they actually the same problems?

Error while creating environment: ninja, crtdefs.h not found

Greetings! I am trying to run this wonderful tool on Windows 11 x64. For the other tools like the viewer, I didnt build them but used the setups you have kindly created for Windows, so thanks for that too! For this repo I ran the commands for creating environment.yml file but in the middle of things it says "crtdefs.h not found", among other errors.

I am trying to use this but I am not an expert in build tools. I have some doubts regarding the following requirements set forth in README.MD:

  • C++ Compiler for PyTorch extensions (we used Visual Studio 2019 for Windows)
  • CUDA SDK 11 for PyTorch extensions (we used 11.8, known issues with 11.6)
  • C++ Compiler and CUDA SDK must be compatible

q1. I have Visual Studio 2022 x64 installed. Is having it installed enough?

q2. I have noticed that creating the environment the first time automatically installs and sets up cuda for py, etc. I still downloaded and setup CUDA Toolkit 11.8 from official developer.nvidia.com. All are x64 bit.

q3. I suppose I could build the submodules by opening them in Visual Studio myself but I would prefer not to.. So I tried to look up for online solutions for where the missing libraries are and adding their folders to path. At first activating the environment said "Cant find ninja, falling back to slow old tools.. Cannot find cl.exe"

I found the file at: %ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64 and added it to path, thereafter I believe it has fixed the issue.

Visual Studio proceeded to the next issue: "crtdefs.h". There is one big difference that In my case the Visual Studio directory has a different structure than most solutions given online for missing libraries and utils, probably because MS keeps shifting headers around.

I had crtdefs.h in both these directories, I added the first one to path, but hasnt worked:
%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\
%ProgramFiles%\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\VC\include\

Online solutions that are using older versions of VS have this header present at the following path:
%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\include\

What I also tried was opening the submodules like diff-gaussian-rasterization on Visual Studio and building them from there assuming Visual Studio would know where to get the missing headers, and that building suceeded. but nothing to help with this issue. I therefore cannot proceed with the setup. Kindly help. Heres the full trace:

D:\gaussian-splatting>conda env create --file environment.yml
Retrieving notices: ...working... done
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: | "By downloading and using the CUDA Toolkit conda packages, you accept the terms and conditions of the CUDA End User License Agreement (EULA): https://docs.nvidia.com/cuda/eula/index.html"

done
Installing pip dependencies: / Ran pip subprocess with arguments:
['C:\\Users\\User\\miniconda3\\envs\\gaussian_splatting\\python.exe', '-m', 'pip', 'install', '-U', '-r', 'D:\\gaussian-splatting\\condaenv.wui8rdg4.requirements.txt', '--exists-action=b']
Pip subprocess output:
Processing D:\gaussian-splatting\submodules\diff-gaussian-rasterization
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Processing D:\gaussian-splatting\submodules\simple-knn
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: diff-gaussian-rasterization, simple-knn
  Building wheel for diff-gaussian-rasterization (setup.py): started
  Building wheel for diff-gaussian-rasterization (setup.py): finished with status 'error'
  Running setup.py clean for diff-gaussian-rasterization
  Building wheel for simple-knn (setup.py): started
  Building wheel for simple-knn (setup.py): finished with status 'error'
  Running setup.py clean for simple-knn
Failed to build diff-gaussian-rasterization simple-knn
Installing collected packages: simple-knn, diff-gaussian-rasterization
  Running setup.py install for simple-knn: started
  Running setup.py install for simple-knn: finished with status 'error'

Pip subprocess error:
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
        warnings.warn(msg.format('we could not find ninja.'))
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-37
      creating build\lib.win-amd64-cpython-37\diff_gaussian_rasterization
      copying diff_gaussian_rasterization\__init__.py -> build\lib.win-amd64-cpython-37\diff_gaussian_rasterization
      running build_ext
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.8) has a minor version mismatch with the version that was used to compile PyTorch (11.6). Most likely this shouldn't be a problem.
        warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
      building 'diff_gaussian_rasterization._C' extension
      creating build\temp.win-amd64-cpython-37
      creating build\temp.win-amd64-cpython-37\Release
      creating build\temp.win-amd64-cpython-37\Release\cuda_rasterizer
      "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc" -c cuda_rasterizer/backward.cu -o build\temp.win-amd64-cpython-37\Release\cuda_rasterizer/backward.obj -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\TH -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\User\miniconda3\envs\gaussian_splatting\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\Include -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -ID:\gaussian-splatting\submodules\diff-gaussian-rasterization\third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61 --use-local-env
      C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\crt/host_config.h(231): fatal error C1083: Cannot open include file: 'crtdefs.h': No such file or directory
      backward.cu
      error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\bin\\nvcc.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for diff-gaussian-rasterization
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
        warnings.warn(msg.format('we could not find ninja.'))
      running build
      running build_ext
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.8) has a minor version mismatch with the version that was used to compile PyTorch (11.6). Most likely this shouldn't be a problem.
        warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
      building 'simple_knn._C' extension
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\TH -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\User\miniconda3\envs\gaussian_splatting\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\Include /EHsc /Tpext.cpp /Fobuild\temp.win-amd64-cpython-37\Release\ext.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /wd4624 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
      ext.cpp
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\torch\csrc\api\include\torch/cuda.h(5): fatal error C1083: Cannot open include file: 'cstdint': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\Hostx64\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for simple-knn
  error: subprocess-exited-with-error

  × Running setup.py install for simple-knn did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      running install
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!

              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.

              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************

      !!
        self.initialize_options()
      running build
      running build_ext
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
        warnings.warn(msg.format('we could not find ninja.'))
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.8) has a minor version mismatch with the version that was used to compile PyTorch (11.6). Most likely this shouldn't be a problem.
        warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
      building 'simple_knn._C' extension
      creating build
      creating build\temp.win-amd64-cpython-37
      creating build\temp.win-amd64-cpython-37\Release
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\TH -IC:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\User\miniconda3\envs\gaussian_splatting\include -IC:\Users\User\miniconda3\envs\gaussian_splatting\Include /EHsc /Tpext.cpp /Fobuild\temp.win-amd64-cpython-37\Release\ext.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /wd4624 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
      ext.cpp
      C:\Users\User\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\include\torch\csrc\api\include\torch/cuda.h(5): fatal error C1083: Cannot open include file: 'cstdint': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\Hostx64\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> simple-knn

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

failed

CondaEnvException: Pip failed


How to parse the `geomBuffer, binningBuffer, imgBuffer`

Hi Thanks for sharing this great work. I wondering is there any ways to parse the geomBuffer, binningBuffer, imgBuffer returned by rasterize_gaussians? I tried but didn't figure out a correct ways to parse those buffers.

Module install error

Error running;
conda env create --file environment.yml

message;

Installing pip dependencies: - Ran pip subprocess with arguments:
['C:\\Users\\admin\\.conda\\envs\\gaussian_splatting\\python.exe', '-m', 'pip', 'install', '-U', '-r', 'C:\\gaussian-splatting\\condaenv.5o1tubvd.requirements.txt', '--exists-action=b']
Pip subprocess output:

Pip subprocess error:
ERROR: Directory 'submodules/diff-gaussian-rasterization' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

failed

CondaEnvException: Pip failed

Because these modules are not installed I cannot run train.py

(gaussian_splatting) C:\gaussian-splatting>python train.py -s C:\gaussian-splatting\data\test
Traceback (most recent call last):
  File "train.py", line 16, in <module>
    from gaussian_renderer import render, network_gui
  File "C:\gaussian-splatting\gaussian_renderer\__init__.py", line 14, in <module>
    from diff_gaussian_rasterization import GaussianRasterizationSettings, GaussianRasterizer
ModuleNotFoundError: No module named 'diff_gaussian_rasterization'

These folders are empty, should they contain anything.. any suggestions?

Accessing SIBR Viewer through X11 on Mac or XMing on Windows

Hi. I have the SIBR Viewer setup on an Ubuntu 22.04 machine which fully satisfies the mentioned requirements (hardware and software). The required dependencies for the SIBR viewer are there and the build finished successfully.

In order to run the GUI-based Remote Gaussian SIBR Viewer, I SSH'ed into my server using X11 on MacOS and XMing (with PuTTY) on Windows with the -X flag in the ssh command and ensured that the DISPLAY env variable is properly configured.

Upon running the following command: ./SIBR_remoteGaussian_app command, I get the following output:

MacOS

[SIBR] --  INFOS  --:   Initialization of GLFW
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[SIBR] ##  ERROR  ##:	FILE /home/paperspace/gaussian-splatting/SIBR_viewers/src/core/graphics/Window.cpp
			LINE 30, FUNC glfwErrorCallback
			GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is unavailable
terminate called after throwing an instance of 'std::runtime_error'

Window

[SIBR] --  INFOS  --:   Initialization of GLFW
[SIBR] ##  ERROR  ##:	FILE /home/paperspace/gaussian-splatting/SIBR_viewers/src/core/graphics/Window.cpp
			LINE 30, FUNC glfwErrorCallback
			GLX: GLX version 1.3 is required
terminate called after throwing an instance of 'std::runtime_error'

Server Specifications:

OS: Ubuntu 22.04
GPU: A100

convert.py mess up with folders: The system cannot find the path specified: '<location>/sparse'

After set up folder as /input with images in there (tested with jpg and png files), and running: python .\convert.py -s <location> --resize, the script fails with the error stated on the title:

Traceback (most recent call last):
  File ".\convert.py", line 63, in <module>
    files = os.listdir(args.source_path + "/sparse")
FileNotFoundError: [WinError 3] The system cannot find the path specified: '<location>/sparse'

If I create the folder '<location>/sparse' manually, then it creates images_N folders and fails with the following error:

Copying and resizing...
Traceback (most recent call last):
  File ".\convert.py", line 81, in <module>
    files = os.listdir(args.source_path + "/images")
FileNotFoundError: [WinError 3] The system cannot find the path specified: '<location>/images'

Finally, If again <location>/images folder is created, the script doesn't fail but it doesn't do anything as well:

Copying and resizing...
Done.

Tested on latest main branch, on windows 11.

BTW thank you for the great work, and for sharing the source code, amaizing!

`do_shs_python` related to `convert_SHs_python`?

Hallo, Thanks for the great work!

I saw the remote Gaussian visualizer return the message do_shs_python, and the assigned params is not used anywhere.

custom_cam, do_training, pipe.do_shs_python, pipe.do_cov_python, keep_alive, scaling_modifer = network_gui.receive()

and the param is assigned to pipe the config for pipeline, and there has been a param convert_SHs_python.

class PipelineParams(ParamGroup):
def __init__(self, parser):
self.convert_SHs_python = False
self.compute_cov3D_python = False
self.debug = False
super().__init__(parser, "Pipeline Parameters")

Is there any relation between the 2 params? what is the logic behind it?

Random Point Initialization

Thank you very much for sharing the amazing work.

Is there any easy way to try random point initialization instead of SfM points as shown in Table 3 in the paper?
I don't find the argument options in train.py.

Sincerely,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.