video to gaussian splat within minutes.
Project description
🎥 Splatpy
Transform videos into stunning 3D Gaussian Splats in minutes.
Left: Input Video | Right: 3D Gaussian Splat Result
Installation
Requirements:
- NVIDIA Driver: Compatible with CUDA 12.4+ (Driver version ≥ 550.54 on Linux / ≥ 551.61 on Windows)
- CUDA Toolkit: 12.4+ (required for compilation)
- Python: 3.10+
- FFmpeg
⚠️ Note: Due to CUDA requirements, this package cannot be installed via pip install splatpy.
Please follow the instructions below.
Using uv (recommended)
uv sync --python 3.10
source .venv/bin/activate
python src/main.py
Using pip
Install torch manually with the correct CUDA version, then install splatpy from source:
python3.10 -m venv venv
source venv/bin/activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
pip install --no-build-isolation git+https://github.com/cesipy/splatpy.git
Note: --no-build-isolation is required because gsplat and fused-ssim need PyTorch during compilation.
Quick Start
The following video formats are supported:
- MP4 (
.mp4) - AVI (
.avi) - MOV (
.mov)
Simple Usage (Recommended)
from splatpy import video_to_splat
# Convert video to 3D Gaussian Splat with quality preset
output = video_to_splat("path/to/video.mp4", quality="medium")
print(f"Splat saved to: {output}")
Quality presets:
"test": Quick test run (1k steps, frames_modulo=30, sift_features=256)"low": Fast preview (10k steps, frames_modulo=30, sift_features=1024)"medium": Balanced quality (20k steps, frames_modulo=20, sift_features=2048) [default]"high": High quality (50k steps, frames_modulo=15, sift_features=4096)"ultra": Maximum quality (100k steps, frames_modulo=10, sift_features=8192)
Advanced Usage
For full control over training parameters:
from splatpy import video_to_splat_advanced
output = video_to_splat_advanced(
video_path="path/to/video.mp4",
output_dir="results/",
training_steps=50_000,
frames_modulo=10, # Extract every 10th frame
data_factor=1, # Full resolution images
colmap_mode="sequential",
sh_degree=3, # Spherical harmonics degree
render_orbit=True,
orbit_frames=240
)
Custom Configuration
For maximum control, use the TrainingConfig class:
from splatpy import video_to_splat_advanced, TrainingConfig
from gsplat.strategy import MCMCStrategy
config = TrainingConfig(
data_dir="res/output/",
data_factor=1,
results_dir="res/results/",
sh_degree=3,
means_lr=1.6e-4,
scales_lr=5e-3,
opacities_lr=5e-2,
strategy=MCMCStrategy()
)
output = video_to_splat_advanced(
video_path="path/to/video.mp4",
custom_config=config,
training_steps=100_000
)
How it works
The pipeline is straightforward:
- Frame extraction - sample frames from input video at regular intervals
- COLMAP - Structure-from-Motion (SfM) to estimate camera poses and a sparse point cloud.
- Training - optimize 3D Gaussians using differentiable rasterization
- Export - save as .ply files compatible with standard viewers
Training uses a combination of L1, SSIM, and LPIPS losses. The Gaussians are initialized from COLMAP's sparse point cloud.
Development
For Development you need extra dependencies (e.g. pytest):
# Install with dev dependencies (to run tests)
uv sync --python 3.10 --all-extras
# Run all tests
pytest
Bugs, issues, and contributions are welcome!
Project structure
src/splatpy/
api.py - main entry point
trainer.py - training loop
config.py - configuration dataclass
incremental_pipeline.py - COLMAP wrapper
utils/
colmap_datahandling.py
utils.py
TODOs
- Auto-detect frame count from video metadata
- Add progress callbacks
- Web viewer for results
- Support for pycolmap-cuda-12 (needs build from source)
- Automatically detect number of frames extracted from video
- Add evaluation metrics (PSNR, SSIM, LPIPS)
- Support for image folder input (not just video)
- Automatic downscaling of images
- CLI tool
- Dockerize
- pylint
🙏 Acknowledgments
Built with:
Test video:
- "House 360 Aerial Orbit" by Aerial Photography & Drone Video
Made with ❤️ by the Splatpy team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splatpy-0.1.1.tar.gz.
File metadata
- Download URL: splatpy-0.1.1.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910a8c061fecc6eeb0cb8e633817d5ad6d8cb3df0c729293994d22e169255cea
|
|
| MD5 |
44107717722864a85fe14a066474dab4
|
|
| BLAKE2b-256 |
39434d50ea2cd547ea4add4688e8e208e3a7f26671fe086cc9dde432a8c55d2e
|
File details
Details for the file splatpy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: splatpy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0288c7fe24710cbfb4edeb3092f743fac18b7b8ef92a60121e6e1aa1b58a5fb5
|
|
| MD5 |
86697e5d7f7dcf26a8650f2861b58d32
|
|
| BLAKE2b-256 |
94e7dc61dc6ecae19d6c6c919ac5bff86c274a609cd447cf093112c32f5ada94
|