Python bindings for streamlined 3D Gaussian Splatting rendering.
- This is a more modularized and organized code of my previous c++ project vkgs.
garden.mp4
Splatstream interactive viewer for "garden" scene.
mvp_compressed.mp4
Splatstream interactive viewer for MVP pre-trained model.
- Fast rendering: GPU-accelerated rasterization for high performance
- Up to 2x faster than vk_gaussian_splatting viewer
- Up to 1.3x faster than gsplat off-screen rendering
- Memory-efficient: resource reuse through double buffering
- Pure Vulkan implementation with minimal dependencies, no CUDA required
- Compatible with pre-trained models from the original Gaussian Splatting
- Interactive viewer
Install the stable version from PyPI:
$ pip install splatstreamOr install the development version from source:
$ pip install --no-build-isolation ./bindingimport splatstream as ss
# Splats from .ply file
splats = ss.load_from_ply("my_splats.ply")
# Or, from numpy array
splats = ss.gaussian_splats(
means, # np.ndarray, (N, 3)
quats, # np.ndarray, (N, 4), wxyz convention.
scales, # np.ndarray, (N, 3)
opacities, # np.ndarray, (N)
colors, # np.ndarray, (N, K, 3), where K is one of [1, 4, 9, 16]
)
# Show in viewer
ss.show(splats) # opens an interactive viewer
# Show in viewer with camera params
ss.show(
splats,
viewmats, # np.ndarray, (..., 4, 4)
Ks, # np.ndarray, (..., 3, 3)
width, # int
height, # int
)
# Draw to numpy array
images = ss.draw(
splats,
viewmats, # np.ndarray, (..., 4, 4)
Ks, # np.ndarray, (..., 3, 3)
width, # int
height, # int
near=0.1, far=1e3 # Do not use too low near nor too high far, otherwise z-fighting
).numpy() # np.ndarray, (..., H, W, 4), np.uint8, RGBA.
from PIL import Image
for i in range(len(images)):
Image.fromarray(images[i, :, :, :3]).save(f"color_{i}.png")
Image.fromarray(images[i, :, :, 3]).save(f"alpha_{i}.png")- WASD/Space to move
- Q/E to roll
- Left drag to rotate
- Right drag to move
- L+R drag or wheel to zoom
- Ctrl wheel to dolly zoom (change FOV angle)
- GPU with Vulkan 1.4+ support (check compatibility)
- Up-to-date graphics drivers
- Python >= 3.10
- Supported platforms: Windows x64, Ubuntu x64, macOS arm64
- Monitor required for the viewer program
- No gradient computation; rendering only, not training
- Perfect pinhole cameras only
- Rendered images may differ slightly from gsplat (likely due to splat culling logic)
- No PyTorch integration
This project redistributes a modified subset of the Gaussian Splatting dataset.
The dataset is available here (Google Drive link).
See the LICENSE file in the dataset for details.
Download the datasets to the models/ directory.
To run the viewer with a pre-trained 3DGS scene:
$ python test/test_viewer.py --scene <scene>
$ python test/test_viewer.py --scene <scene> --no-camerawhere <scene> is one of: bicycle, bonsai, counter, etc.
Tested on NVIDIA GeForce RTX 5080, Windows. FPS measure includes rendering time plus GPU-to-CPU transfer.
| Implementation | Dataset | #imgs | resolution | #splats | PSNR | FPS |
|---|---|---|---|---|---|---|
| gsplat | bicycle | 194 | 1237x822 | 6131954 | 19.18 ± 1.60 | 245.70 |
| splatstream | bicycle | 194 | 1237x822 | 6131954 | 19.22 ± 1.67 | 373.08 |
| gsplat | garden | 185 | 1297x840 | 5834784 | 18.96 ± 0.74 | 196.80 |
| splatstream | garden | 185 | 1297x840 | 5834784 | 19.11 ± 0.74 | 320.93 |
See bench for more details.
See DETAILS.md.
VulkanSDK>=1.4.328.1(set up environment variables per OS)cmake>=3.15(install viapip install cmakeorconda install conda-forge::cmake)python>=3.10
Feedback, feature requests, and issue reports are welcome!
- Device selection