🎥 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
Metadata
Release files for splatpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| splatpy-0.1.1.tar.gz | 25.2 kB | Without provenance | Details for splatpy-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| splatpy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for splatpy-0.1.1-py3-none-any.whl |
Total release size: 50.9 kB
Release files / splatpy-0.1.1.tar.gz
| Download URL | splatpy-0.1.1.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
910a8c061fecc6eeb0cb8e633817d5ad6d8cb3df0c729293994d22e169255cea
|
|
BLAKE2b-256 checksum How to use checksums |
39434d50ea2cd547ea4add4688e8e208e3a7f26671fe086cc9dde432a8c55d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / splatpy-0.1.1-py3-none-any.whl
| Download URL | splatpy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0288c7fe24710cbfb4edeb3092f743fac18b7b8ef92a60121e6e1aa1b58a5fb5
|
|
BLAKE2b-256 checksum How to use checksums |
94e7dc61dc6ecae19d6c6c919ac5bff86c274a609cd447cf093112c32f5ada94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Security for splatpy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.