gsplat: An Open-Source Library for Gaussian Splatting
Paper β’ 2409.06765 β’ Published β’ 17
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Real-Time Deformable 4D Gaussian Splatting for Endoscopic Surgery
A research framework for reconstructing dynamic endoscopic scenes using deformable 3D Gaussian Splatting with HexPlane-encoded temporal deformation fields.
G_t = G_0 + Ξ_ΞΈ(t)
| Component | Description |
|---|---|
| Gβ | Canonical Gaussians {ΞΌ, q, s, Ξ±, SH} initialized via HGI |
| Ξ_ΞΈ | HexPlane encoder β MLP decoder β per-Gaussian deltas |
| HexPlane | 6 feature planes (XY,XZ,YZ,XT,YT,ZT) Γ multi-resolution |
| Decoder | Shared backbone β 4 zero-initialized heads (ΞΞΌ, Ξq, Ξs, ΞΞ±) |
| Renderer | gsplat differentiable rasterization with absgrad |
Target performance: 37.9 PSNR, 0.97 SSIM, 195 FPS, 2 min training (EndoNeRF benchmark)
endogaussian4d/
βββ Dockerfile # CUDA 12.1 + PyTorch 2.3 + gsplat + COLMAP
βββ requirements.txt # Pip dependencies
βββ __init__.py
β
βββ models/
β βββ __init__.py
β βββ trainer.py # EndoGaussianTrainer + HexPlane + Decoder
β βββ metrics.py # PSNR, SSIM, LPIPS, D-SSIM, depth metrics
β
βββ scripts/
β βββ download_datasets.py # Dataset registry + download + unified loader
β βββ extract_poses.py # Multi-stage SfM (COLMAP + Depth-Anything + PnP)
β βββ fast_fail_experiment.py # Static 3DGS baseline + artifact taxonomy
β
βββ configs/
β βββ endonerf.yaml # Default config for EndoNeRF dataset
β βββ c3vd.yaml # Config for C3VD dataset
β βββ fast_fail.yaml # Config for fast-fail experiment
β
βββ docs/
βββ formalization.tex # LaTeX mathematical formalization (CVPR-style)
βββ formalization.md # Markdown version of the math
EndoDataset loader supporting LLFF/C3VD/EndoSLAM formatsDatasetOrganizer for download, validation, and manifest generationEndoGaussianTrainer with HexPlane deformation# Using Docker (recommended)
docker build -t endogaussian4d .
docker run --gpus all -it endogaussian4d bash
# Or using pip
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
# List available datasets
python scripts/download_datasets.py --list
# Download EndoNeRF (smallest, auto-downloadable, standard benchmark)
python scripts/download_datasets.py --datasets endonerf --data-root ./data
# Validate installation
python scripts/download_datasets.py --validate --data-root ./data
# Auto mode: tries COLMAP first, falls back to Depth-Anything + PnP
python scripts/extract_poses.py --input ./data/endonerf/cutting --mode auto
# Force learning-based pipeline (for texture-less tissue)
python scripts/extract_poses.py --input ./data/endonerf/cutting --mode depth_pnp --hgi
# Benchmark static 3DGS on dynamic tissue (documents failure modes)
python scripts/fast_fail_experiment.py \
--data ./data/endonerf/cutting \
--output ./experiments/fast_fail \
--max-iters 1000
from models.trainer import EndoGaussianTrainer, EndoGaussianConfig
from scripts.download_datasets import EndoDataset
# Load dataset
dataset = EndoDataset("./data/endonerf/cutting")
points, colors = dataset.get_point_cloud(subsample=0.001)
# Configure and train
config = EndoGaussianConfig(
total_iters=3000,
warmup_iters=1000,
output_dir="./output",
experiment_name="cutting_v1",
)
trainer = EndoGaussianTrainer(config)
trainer.initialize_from_point_cloud(points, colors, cameras=[])
# trainer.train(dataset) # Requires GPU + torch Dataset wrapper
| Dataset | Sequences | Resolution | Depth | Poses | Access |
|---|---|---|---|---|---|
| EndoNeRF | 2 | 320Γ256 | β GT | β | Auto (Dropbox) |
| C3VD | 22 | 675Γ540 | β GT | β | Request form |
| SCARED | 7 | 1280Γ1024 | β GT | β | Registration |
| StereoMIS | 11 | 640Γ480 | Stereo | β | Auto (Zenodo) |
| EndoSLAM | 35 | 640Γ480 | Synthetic | β | Auto (GitHub) |
| D4D | 98 | 640Γ480 | β GT | β | Auto (DOI) |
| Hamlyn | 20 | 360Γ288 | β | β | Registration |
Recommended for initial experiments: EndoNeRF (smallest, auto-download, standard benchmark, includes tool masks)
| Term | Weight | Purpose | Artifact Fixed |
|---|---|---|---|
| L1 | 1-Ξ»β=0.8 | Pixel reconstruction | General quality |
| D-SSIM | Ξ»β=0.2 | Structural similarity | Specular artifacts |
| Depth (SI) | Ξ»β=0.1 | Geometric accuracy | Floaters |
| Smooth | Ξ»β=0.01 | Temporal coherence | Ghosting, tearing |
| TV | Ξ»β=0.001 | HexPlane regularization | Scale bloat |
| Tool mask | β | Exclude instruments | Tool smearing |
Research use only. See individual dataset licenses for data terms.