Pipeline automation of 3D Gaussian Splatting from
https://github.com/graphdeco-inria/gaussian-splatting
Note that 3D Gaussian Splatting should work on both Windows and Linux operating systems. However, I was unable to get it working on current linux systems.
These installation instructions are for Windows Server 2019 with CUDA and a good GPU, because that is the type of Windows system available to us on Research Cloud.
Download git from https://git-scm.com/downloads/win and install it.
Download mamba from https://github.com/conda-forge/miniforge and install it.
- Preferably on an attached storage drive, because conda takes up a huge amount of space.
- Note that conda refuses to install on top of an existing version. Because of it's size, installing it requires first deleting the old install.
- Update conda (the first time, this must be done in the Miniforge Prompt)
conda deactivate
conda update --all
conda init
Note that gaussian-splating is not compatible with later Visual Studio versions.
Download VS Community from https://aka.ms/vs/16/release/vs_community.exe and install it
- Make sure to enable Desktop development with C++
After installation, make sure C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 is in the PATH.
Note that a Research Cloud workspace comes with CUDA 12 installed, but gaussian-splating is not compatible with this version.
Download CUDA toolkit 11.8 from
https://developer.nvidia.com/cuda-11-8-0-download-archive and install it.
This installation depends on the Visual Studio installation.
- Note that the installer may mention that Nsight was not replaced by a newer version check that the current version is 11.8
nvcc --version
Download COLMAP with CUDA from https://github.com/colmap/colmap/releases
Extract the zip to <user>\COLMAP\
Add <user>\COLMAP\ to the Local Path (Search 'edit the system environment variables')
Download ImageMagick from https://imagemagick.org/script/download.php#windows and
install it.
Verify it's working:
magick logo: logo.gif
magick identify logo.gif
Download 7-zip from https://www.7-zip.org/download.html and install it.
Download FFMPEG essentials from https://www.gyan.dev/ffmpeg/builds/
Extract the 7z file to <user>\FFMPEG\
Add <user>\FFMPEG\bin\ to the Local Path.
At this point, you'll want to restart the machine for several of the changes to take effect.
Clone the repository. Note the repository is cloned recusively, because it has several submodules.
git clone https://github.com/graphdeco-inria/gaussian-splatting.git --recursive
Install dependencies, including the accellerated rasterizer. Note that diff-gaussian-rasterization depends on the external CUDA installation.
conda activate base
SET DISTUTILS_USE_SDK=1
cd gaussian-splatting\submodules\diff-gaussian-rasterization
git checkout 3dgs_accel
cd ..\..
conda env create --file environment.yml
conda activate gaussian_splatting
If you run into an error with shm.dll, like
Error loading "[...]\miniforge3\envs\gaussian_splatting\lib\site-packages\torch\lib\shm.dll" or one of its dependencies.
this may be solved by running pip install intel-openmp in the gaussian_splatting environment and, before again calling
conda env create --file environment.yml for the pip install parts.
Note that the repository with weights takes up about 1.35GB and its dependencies about 1.85GB. This is somewhat restrictive on the cloud storage.
Clone repository:
git clone https://github.com/DepthAnything/Depth-Anything-V2.git
Download weights from https://huggingface.co/depth-anything/Depth-Anything-V2-Large/resolve/main/depth_anything_v2_vitl.pth?download=true and place them under Depth-Anything-V2/checkpoints/
Install dependencies. Note that this has to be a different environment to gaussian_splatting (later), because they require different versions of python.
conda create -n depth_anything
conda activate depth_anything
conda install python
pip install -r Depth-Anything-V2\requirements.txt
Either install node.js from http://nodejs.org/
or:
conda activate gaussian_splatting
conda install nodejs
Setup nodejs
conda activate gaussian_splatting
npm install
npm run build-windows
Clone repository
git clone https://github.com/mkkellogg/GaussianSplats3D.git
Demo:
download https://projects.markkellogg.org/downloads/gaussian_splat_data.zip
move to <code>\build\demo\assets\data
npm run demo
Open https://projects.markkellogg.org/threejs/demo_gaussian_splats_3d.php
Note that these methods will skip parts for which output already exists,
unless the optional --force argument is used.
Structure from Motion computes the camera parameters using COLMAP. The output is based on images, if they're present, or frames from a video.
conda activate gaussian_splatting
python sfm.py <absolute\path\to\data\root\> [arguments]
or set the arguments in run_sfm.bat and call
run_sfm.bat <absolute\path\to\data\root\>
Depth images are computed using Depth-Anything-V2. Note that this requires some dependencies with incompatible versions in a different conda environment.
conda activate depth_anything
python depth.py <absolute\path\to\data\root\> [arguments]
or set the arguments in run_depth.bat and call
run_depth.bat <absolute\path\to\data\root\>
3D Gaussian splats are computed using gaussian_splatting. If depth images are present, this may first compute the depth scale parameters.
conda activate gaussian_splatting
python splat.py <absolute\path\to\data\root\> [arguments]
or set the arguments in run_splat.bat and call
run_splat.bat <absolute\path\to\data\root\>
set the arguments in run_pipeline.bat and call
run_pipeline.bat <absolute\path\to\data\root\>