• Stars
    star
    542
  • Rank 78,827 (Top 2 %)
  • Language
    C++
  • License
    GNU Affero Genera...
  • Created 3 months ago
  • Updated 6 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Production-grade 3D gaussian splatting with CPU/GPU support for Windows, Mac and Linux 🚀

💦 OpenSplat

A free and open source implementation of 3D gaussian splatting written in C++, focused on being portable, lean and fast.

OpenSplat

OpenSplat takes camera poses + sparse points in COLMAP or nerfstudio project format and computes a scene file (.ply) that can be later imported for viewing, editing and rendering in other software.

Commercial use allowed and encouraged under the terms of the AGPLv3. ✅

Build (CUDA)

Requirements:

Then:

git clone https://github.com/pierotofy/OpenSplat OpenSplat
cd OpenSplat
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch/ .. && make -j$(nproc)

The software has been tested on Ubuntu 20.04 and Windows. With some changes it could run on macOS (help us by opening a PR?).

Build (ROCm via HIP)

Requirements:

Then:

git clone https://github.com/pierotofy/OpenSplat OpenSplat
cd OpenSplat
mkdir build && cd build
export PYTORCH_ROCM_ARCH=gfx906
cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch/ -DGPU_RUNTIME="HIP" -DHIP_ROOT_DIR=/opt/rocm -DOPENSPLAT_BUILD_SIMPLE_TRAINER=ON ..
make

In addition, you can leverage Jinja to build the project

cmake -GNinja -DCMAKE_PREFIX_PATH=/path/to/libtorch/ -DGPU_RUNTIME="HIP" -DHIP_ROOT_DIR=/opt/rocm -DOPENSPLAT_BUILD_SIMPLE_TRAINER=ON ..
jinja

Docker Build (CUDA)

Navigate to the root directory of OpenSplat repo that has Dockerfile and run the following command to build the Docker image:

docker build -t opensplat .

The -t flag and other --build-arg let you tag and further customize your image across different ubuntu versions, CUDA/libtorch stacks, and hardware accelerators. For example, to build an image with Ubuntu 22.04, CUDA 12.1.1, libtorch 2.2.1, and support for CUDA architectures 7.0 and 7.5, run the following command:

docker build \
  -t opensplat:ubuntu-22.04-cuda-12.1.1-torch-2.2.1 \
  --build-arg UBUNTU_VERSION=22.04 \
  --build-arg CUDA_VERSION=12.1.1 \
  --build-arg TORCH_VERSION=2.2.1 \
  --build-arg TORCH_CUDA_ARCH_LIST="7.0;7.5" \
  --build-arg CMAKE_BUILD_TYPE=Release .

Docker Build (ROCm via HIP)

Navigate to the root directory of OpenSplat repo that has Dockerfile and run the following command to build the Docker image:

docker build -t opensplat -f Dockerfile.rocm .

The -t flag and other --build-arg let you tag and further customize your image across different ubuntu versions, CUDA/libtorch stacks, and hardware accelerators. For example, to build an image with Ubuntu 22.04, CUDA 12.1.1, libtorch 2.2.1, ROCm 5.7.1, and support for ROCm architectures gfx906, run the following command:

docker build \
  -t opensplat:ubuntu-22.04-cuda-12.1.1-libtorch-2.2.1-rocm-5.7.1-llvm-16 \
  --build-arg UBUNTU_VERSION=22.04 \
  --build-arg CUDA_VERSION=12.1.1 \
  --build-arg TORCH_VERSION=2.2.1 \
  --build-arg ROCM_VERSION=5.7.1 \
  --build-arg PYTORCH_ROCM_ARCH="gfx906" \
  --build-arg CMAKE_BUILD_TYPE=Release .

Run

To get started, download a dataset and extract it to a folder: [ banana ] [ train ] [ truck ]

Then run:

./opensplat /path/to/banana -n 2000
[...]
Wrote splat.ply

The output splat.ply can then be dragged and dropped in one of the many viewers such as https://playcanvas.com/viewer. You can also edit/cleanup the scene using https://playcanvas.com/supersplat/editor

To run on your own data, choose the path to an existing COLMAP or nerfstudio project. The project must have sparse points included (random initialization is not supported, see #7).

There's several parameters you can tune. To view the full list:

./opensplat --help

Project Goals

We recently released OpenSplat, so there's lots of work to do.

  • Support for running on AMD cards (more testing needed)
  • Support for running on CPU-only
  • Improve speed / reduce memory usage
  • Distributed computation using multiple machines
  • Real-time training viewer output
  • Compressed scene outputs
  • Your ideas?

https://github.com/pierotofy/OpenSplat/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement

Contributing

We welcome contributions! Pull requests are welcome.

GPU Memory Notes

A single gaussian takes ~2000 bytes of memory, so currenly you need ~2GB of GPU memory for each million gaussians.

Credits

The methods used in OpenSplat are originally based on splatfacto.

License

The code in this repository, unless otherwise noted, is licensed under the AGPLv3.

The code from splatfacto is originally licensed under the Apache 2.0 license and is © 2023 The Nerfstudio Team.

More Repositories

1

set-swap-space

GitHub Action to Increase Swap Space on GitHub Runners
45
star
2

PokerMuck

Open Source Poker HUD
C#
36
star
3

glassomium

Open-source cross-platform web-based TUIO-enabled multi-touch window manager
JavaScript
21
star
4

hscroller.js

A horizontal scrolling single page web template
JavaScript
17
star
5

snappyfrog

Source code of Snappy Frog, a libgdx game that has been ported to the Desktop, Android, iOS, OUYA and the Amazon Fire
Java
11
star
6

historical_aerial_downloader

A very rough script to download and add EXIF georeferencing information to historical aerial images archives
Python
10
star
7

exifimageresize

Resize Images, Keep Exif Data
Python
6
star
8

dataset_banana

Everyone loves bananas
5
star
9

issuewhiz

IssueWhiz automates the triaging of issues in your repositories. It helps streamline the process of categorizing issues and enforcing project's guidelines using customizable and flexible rules.
JavaScript
3
star
10

k4freeserver

Ruby
3
star
11

node-map2dfusion

JavaScript
2
star
12

objpacker

Takes a Wavefront OBJ with textures and attempts to squash them into a single texture file.
Python
2
star
13

pierotofy.it

Repository Ufficiale del sito http://www.pierotofy.it
PHP
2
star
14

drone_dataset_brighton_beach

2
star
15

drone_dataset_sheffield_cross

2
star
16

uavutils

Python scripts for UAV image processing
Python
1
star
17

DEMTools

Python
1
star
18

ChessOpeningsTrainer

Swift
1
star
19

drone_dataset_brighton_spaces

1
star
20

webodm-posm-gcpi

Prebuilt code of posm-gcpi for WebODM
HTML
1
star
21

drone_dataset_mica_split

1
star
22

MagicGesture.js

A simple gesture event generator for those multi touch devices that do not support them natively.
JavaScript
1
star
23

drone_dataset_sheffield_park_1

1
star
24

riegl-utils

Scripts and tools for Riegl equipment
Python
1
star
25

pygeovolume

Volume calculations on georeferenced raster DEMs
Python
1
star