lapisgs 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lapisgs-1.0.0/LICENSE +21 -0
- lapisgs-1.0.0/LICENSE.md +91 -0
- lapisgs-1.0.0/PKG-INFO +331 -0
- lapisgs-1.0.0/README.md +319 -0
- lapisgs-1.0.0/lapisgs/dataset/__init__.py +2 -0
- lapisgs-1.0.0/lapisgs/dataset/colmap.py +25 -0
- lapisgs-1.0.0/lapisgs/dataset/dataset.py +66 -0
- lapisgs-1.0.0/lapisgs/prepare.py +54 -0
- lapisgs-1.0.0/lapisgs/prepare_reduced.py +36 -0
- lapisgs-1.0.0/lapisgs/render.py +34 -0
- lapisgs-1.0.0/lapisgs/train.py +48 -0
- lapisgs-1.0.0/lapisgs/train_full_pipeline.py +41 -0
- lapisgs-1.0.0/lapisgs/train_full_pipeline_reduced.py +43 -0
- lapisgs-1.0.0/lapisgs/train_reduced.py +49 -0
- lapisgs-1.0.0/lapisgs/trainer/__init__.py +4 -0
- lapisgs-1.0.0/lapisgs/trainer/combinations.py +34 -0
- lapisgs-1.0.0/lapisgs/trainer/densifier/__init__.py +2 -0
- lapisgs-1.0.0/lapisgs/trainer/densifier/combinations.py +47 -0
- lapisgs-1.0.0/lapisgs/trainer/densifier/trainer.py +66 -0
- lapisgs-1.0.0/lapisgs/trainer/extensions/reduced_3dgs/__init__.py +7 -0
- lapisgs-1.0.0/lapisgs/trainer/extensions/reduced_3dgs/combinations.py +130 -0
- lapisgs-1.0.0/lapisgs/trainer/extensions/reduced_3dgs/importance.py +60 -0
- lapisgs-1.0.0/lapisgs/trainer/extensions/reduced_3dgs/trainer.py +62 -0
- lapisgs-1.0.0/lapisgs/trainer/opacity_reset.py +43 -0
- lapisgs-1.0.0/lapisgs.egg-info/PKG-INFO +331 -0
- lapisgs-1.0.0/lapisgs.egg-info/SOURCES.txt +29 -0
- lapisgs-1.0.0/lapisgs.egg-info/dependency_links.txt +1 -0
- lapisgs-1.0.0/lapisgs.egg-info/requires.txt +2 -0
- lapisgs-1.0.0/lapisgs.egg-info/top_level.txt +1 -0
- lapisgs-1.0.0/setup.cfg +4 -0
- lapisgs-1.0.0/setup.py +40 -0
lapisgs-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Project VVStreams
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
lapisgs-1.0.0/LICENSE.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Gaussian-Splatting License
|
|
2
|
+
===========================
|
|
3
|
+
|
|
4
|
+
**Inria** and **the Max Planck Institut for Informatik (MPII)** hold all the ownership rights on the *Software* named **gaussian-splatting**.
|
|
5
|
+
The *Software* is in the process of being registered with the Agence pour la Protection des
|
|
6
|
+
Programmes (APP).
|
|
7
|
+
|
|
8
|
+
The *Software* is still being developed by the *Licensor*.
|
|
9
|
+
|
|
10
|
+
*Licensor*'s goal is to allow the research community to use, test and evaluate
|
|
11
|
+
the *Software*.
|
|
12
|
+
|
|
13
|
+
## 1. Definitions
|
|
14
|
+
|
|
15
|
+
*Licensee* means any person or entity that uses the *Software* and distributes
|
|
16
|
+
its *Work*.
|
|
17
|
+
|
|
18
|
+
*Licensor* means the owners of the *Software*, i.e Inria and MPII
|
|
19
|
+
|
|
20
|
+
*Software* means the original work of authorship made available under this
|
|
21
|
+
License ie gaussian-splatting.
|
|
22
|
+
|
|
23
|
+
*Work* means the *Software* and any additions to or derivative works of the
|
|
24
|
+
*Software* that are made available under this License.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 2. Purpose
|
|
28
|
+
This license is intended to define the rights granted to the *Licensee* by
|
|
29
|
+
Licensors under the *Software*.
|
|
30
|
+
|
|
31
|
+
## 3. Rights granted
|
|
32
|
+
|
|
33
|
+
For the above reasons Licensors have decided to distribute the *Software*.
|
|
34
|
+
Licensors grant non-exclusive rights to use the *Software* for research purposes
|
|
35
|
+
to research users (both academic and industrial), free of charge, without right
|
|
36
|
+
to sublicense.. The *Software* may be used "non-commercially", i.e., for research
|
|
37
|
+
and/or evaluation purposes only.
|
|
38
|
+
|
|
39
|
+
Subject to the terms and conditions of this License, you are granted a
|
|
40
|
+
non-exclusive, royalty-free, license to reproduce, prepare derivative works of,
|
|
41
|
+
publicly display, publicly perform and distribute its *Work* and any resulting
|
|
42
|
+
derivative works in any form.
|
|
43
|
+
|
|
44
|
+
## 4. Limitations
|
|
45
|
+
|
|
46
|
+
**4.1 Redistribution.** You may reproduce or distribute the *Work* only if (a) you do
|
|
47
|
+
so under this License, (b) you include a complete copy of this License with
|
|
48
|
+
your distribution, and (c) you retain without modification any copyright,
|
|
49
|
+
patent, trademark, or attribution notices that are present in the *Work*.
|
|
50
|
+
|
|
51
|
+
**4.2 Derivative Works.** You may specify that additional or different terms apply
|
|
52
|
+
to the use, reproduction, and distribution of your derivative works of the *Work*
|
|
53
|
+
("Your Terms") only if (a) Your Terms provide that the use limitation in
|
|
54
|
+
Section 2 applies to your derivative works, and (b) you identify the specific
|
|
55
|
+
derivative works that are subject to Your Terms. Notwithstanding Your Terms,
|
|
56
|
+
this License (including the redistribution requirements in Section 3.1) will
|
|
57
|
+
continue to apply to the *Work* itself.
|
|
58
|
+
|
|
59
|
+
**4.3** Any other use without of prior consent of Licensors is prohibited. Research
|
|
60
|
+
users explicitly acknowledge having received from Licensors all information
|
|
61
|
+
allowing to appreciate the adequacy between of the *Software* and their needs and
|
|
62
|
+
to undertake all necessary precautions for its execution and use.
|
|
63
|
+
|
|
64
|
+
**4.4** The *Software* is provided both as a compiled library file and as source
|
|
65
|
+
code. In case of using the *Software* for a publication or other results obtained
|
|
66
|
+
through the use of the *Software*, users are strongly encouraged to cite the
|
|
67
|
+
corresponding publications as explained in the documentation of the *Software*.
|
|
68
|
+
|
|
69
|
+
## 5. Disclaimer
|
|
70
|
+
|
|
71
|
+
THE USER CANNOT USE, EXPLOIT OR DISTRIBUTE THE *SOFTWARE* FOR COMMERCIAL PURPOSES
|
|
72
|
+
WITHOUT PRIOR AND EXPLICIT CONSENT OF LICENSORS. YOU MUST CONTACT INRIA FOR ANY
|
|
73
|
+
UNAUTHORIZED USE: stip-sophia.transfert@inria.fr . ANY SUCH ACTION WILL
|
|
74
|
+
CONSTITUTE A FORGERY. THIS *SOFTWARE* IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES
|
|
75
|
+
OF ANY NATURE AND ANY EXPRESS OR IMPLIED WARRANTIES, WITH REGARDS TO COMMERCIAL
|
|
76
|
+
USE, PROFESSIONNAL USE, LEGAL OR NOT, OR OTHER, OR COMMERCIALISATION OR
|
|
77
|
+
ADAPTATION. UNLESS EXPLICITLY PROVIDED BY LAW, IN NO EVENT, SHALL INRIA OR THE
|
|
78
|
+
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
79
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
80
|
+
GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION)
|
|
81
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
82
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING FROM, OUT OF OR
|
|
83
|
+
IN CONNECTION WITH THE *SOFTWARE* OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE*.
|
|
84
|
+
|
|
85
|
+
## 6. Files subject to permissive licenses
|
|
86
|
+
The contents of the file ```utils/loss_utils.py``` are based on publicly available code authored by Evan Su, which falls under the permissive MIT license.
|
|
87
|
+
|
|
88
|
+
Title: pytorch-ssim\
|
|
89
|
+
Project code: https://github.com/Po-Hsun-Su/pytorch-ssim\
|
|
90
|
+
Copyright Evan Su, 2017\
|
|
91
|
+
License: https://github.com/Po-Hsun-Su/pytorch-ssim/blob/master/LICENSE.txt (MIT)
|
lapisgs-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: lapisgs
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Refactored python training and inference code for 3D Gaussian Splatting
|
|
5
|
+
Home-page: https://github.com/yindaheng98/lapis-gs
|
|
6
|
+
Author: yindaheng98
|
|
7
|
+
Author-email: yindaheng98@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: LICENSE.md
|
|
12
|
+
|
|
13
|
+
# LapisGS: Layered Progressive 3D Gaussian Splatting for Adaptive Streaming (Packaged Python Version)
|
|
14
|
+
|
|
15
|
+
This repository contains the **refactored Python code for [LapisGS](https://github.com/nus-vv-streams/lapis-gs)**. It is forked from commit [12dcda37ed43838d7407b28675bc26b7364ae431](https://github.com/nus-vv-streams/lapis-gs/tree/12dcda37ed43838d7407b28675bc26b7364ae431). The original code has been **refactored to follow the standard Python package structure**, while **maintaining the same algorithms as the original version**.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
* [x] Code organized as a standard Python package
|
|
20
|
+
* [x] Layered progressive 3D Gaussian Splatting
|
|
21
|
+
* [x] Multi-resolution training pipeline
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
* [Pytorch](https://pytorch.org/) (v2.4 or higher recommended)
|
|
26
|
+
* [CUDA Toolkit](https://developer.nvidia.com/cuda-12-4-0-download-archive) (12.4 recommended, should match with PyTorch version)
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
### PyPI Install
|
|
31
|
+
|
|
32
|
+
```shell
|
|
33
|
+
pip install --upgrade lapis-gs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Install (Development)
|
|
37
|
+
|
|
38
|
+
Install [`gaussian-splatting`](https://github.com/yindaheng98/gaussian-splatting).
|
|
39
|
+
You can download the wheel from [PyPI](https://pypi.org/project/gaussian-splatting/):
|
|
40
|
+
```shell
|
|
41
|
+
pip install --upgrade gaussian-splatting
|
|
42
|
+
```
|
|
43
|
+
Alternatively, install the latest version from the source:
|
|
44
|
+
```sh
|
|
45
|
+
pip install --upgrade git+https://github.com/yindaheng98/gaussian-splatting.git@master
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install [`reduced-3dgs`](https://github.com/yindaheng98/reduced-3dgs).
|
|
49
|
+
You can download the wheel from [PyPI](https://pypi.org/project/reduced-3dgs/):
|
|
50
|
+
```shell
|
|
51
|
+
pip install --upgrade reduced-3dgs
|
|
52
|
+
```
|
|
53
|
+
Alternatively, install the latest version from the source:
|
|
54
|
+
```sh
|
|
55
|
+
pip install --upgrade git+https://github.com/yindaheng98/reduced-3dgs.git@main
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
git clone --recursive https://github.com/yindaheng98/lapis-gs
|
|
60
|
+
cd lapis-gs
|
|
61
|
+
pip install tqdm plyfile tifffile
|
|
62
|
+
pip install --target . --upgrade --no-deps .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
(Optional) If you prefer not to install `gaussian-splatting` and `reduced-3dgs` in your environment, you can install them in your `lapis-gs` directory:
|
|
66
|
+
```sh
|
|
67
|
+
pip install --target . --no-deps --upgrade git+https://github.com/yindaheng98/gaussian-splatting.git@master
|
|
68
|
+
pip install --target . --no-deps --upgrade git+https://github.com/yindaheng98/reduced-3dgs.git@main
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
1. Download dataset (T&T+DB COLMAP dataset, size 650MB):
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
wget https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/datasets/input/tandt_db.zip -P ./data
|
|
77
|
+
unzip data/tandt_db.zip -d data/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. Train LapisGS with full pipeline, in this way each layer shares the same training parameters:
|
|
81
|
+
```shell
|
|
82
|
+
python -m lapisgs.train_full_pipeline_reduced -s data/truck -d output/truck -i 30000 --mode base -olambda_dssim=0.8
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
3. (Optional) Train progressive layers (8x → 4x → 2x → 1x), in this way you can modify the training parameters for each layer:
|
|
86
|
+
```shell
|
|
87
|
+
# Train 8x (lowest resolution)
|
|
88
|
+
python -m lapisgs.train_reduced -s data/truck -d output/truck/8x --rescale_factor 0.125 -i 10000 --mode shculling -olambda_dssim=0.8
|
|
89
|
+
|
|
90
|
+
# Train 4x (load from 8x)
|
|
91
|
+
python -m lapisgs.train_reduced -s data/truck -d output/truck/4x --rescale_factor 0.25 -l output/truck/8x/point_cloud/iteration_10000/point_cloud.ply --load_camera output/truck/8x/cameras.json -i 10000 --mode camera-shculling -olambda_dssim=0.8
|
|
92
|
+
|
|
93
|
+
# Train 2x (load from 4x)
|
|
94
|
+
python -m lapisgs.train_reduced -s data/truck -d output/truck/2x --rescale_factor 0.5 -l output/truck/4x/point_cloud/iteration_10000/point_cloud.ply --load_camera output/truck/4x/cameras.json -i 10000 --mode camera-shculling -olambda_dssim=0.8
|
|
95
|
+
|
|
96
|
+
# Train 1x (full resolution, load from 2x)
|
|
97
|
+
python -m lapisgs.train_reduced -s data/truck -d output/truck/1x --rescale_factor 1.0 -l output/truck/2x/point_cloud/iteration_10000/point_cloud.ply --load_camera output/truck/2x/cameras.json -i 10000 --mode camera-shculling -olambda_dssim=0.8
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
4. Render LapisGS at different resolutions:
|
|
101
|
+
```shell
|
|
102
|
+
# Render 8x
|
|
103
|
+
python -m lapisgs.render -s data/truck -d output/truck/8x -i 10000 --mode base --load_camera output/truck/8x/cameras.json --rescale_factor 0.125
|
|
104
|
+
|
|
105
|
+
# Render 4x
|
|
106
|
+
python -m lapisgs.render -s data/truck -d output/truck/4x -i 10000 --mode camera --load_camera output/truck/4x/cameras.json --rescale_factor 0.25
|
|
107
|
+
|
|
108
|
+
# Render 2x
|
|
109
|
+
python -m lapisgs.render -s data/truck -d output/truck/2x -i 10000 --mode camera --load_camera output/truck/2x/cameras.json --rescale_factor 0.5
|
|
110
|
+
|
|
111
|
+
# Render 1x (full resolution)
|
|
112
|
+
python -m lapisgs.render -s data/truck -d output/truck/1x -i 10000 --mode camera --load_camera output/truck/1x/cameras.json --rescale_factor 1.0
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
> 💡 This repo does not contain code for creating dataset.
|
|
116
|
+
> If you want to create your own dataset, please refer to [InstantSplat](https://github.com/yindaheng98/InstantSplat) or use [convert.py](https://github.com/graphdeco-inria/gaussian-splatting/blob/main/convert.py).
|
|
117
|
+
|
|
118
|
+
> 💡 See [.vscode/launch.json](.vscode/launch.json) for advanced examples. See `lapisgs.train_full_pipeline_reduced` and `lapisgs.train_reduced` for full options.
|
|
119
|
+
|
|
120
|
+
## API Usage
|
|
121
|
+
|
|
122
|
+
This project is built on top of [`gaussian-splatting`](https://github.com/yindaheng98/gaussian-splatting) and [`reduced-3dgs`](https://github.com/yindaheng98/reduced-3dgs). Please refer to their documentation for basic usage of Gaussian models, datasets, and trainers.
|
|
123
|
+
|
|
124
|
+
### Gaussian Models
|
|
125
|
+
|
|
126
|
+
LapisGS uses the standard Gaussian models from `gaussian-splatting`:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from gaussian_splatting import GaussianModel, CameraTrainableGaussianModel
|
|
130
|
+
|
|
131
|
+
# Standard Gaussian model
|
|
132
|
+
gaussians = GaussianModel(sh_degree).to(device)
|
|
133
|
+
|
|
134
|
+
# For camera-trainable scenarios
|
|
135
|
+
gaussians = CameraTrainableGaussianModel(sh_degree).to(device)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Multi-Resolution Datasets
|
|
139
|
+
|
|
140
|
+
LapisGS provides rescale-aware dataset classes for multi-resolution training:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from lapisgs.dataset import RescaleColmapCameraDataset, RescaleTrainableCameraDataset
|
|
144
|
+
|
|
145
|
+
# For standard training
|
|
146
|
+
dataset = RescaleColmapCameraDataset(source_path, rescale_factor=0.125, load_depth=True) # 8x
|
|
147
|
+
dataset = RescaleColmapCameraDataset(source_path, rescale_factor=0.25, load_depth=True) # 4x
|
|
148
|
+
dataset = RescaleColmapCameraDataset(source_path, rescale_factor=0.5, load_depth=True) # 2x
|
|
149
|
+
dataset = RescaleColmapCameraDataset(source_path, rescale_factor=1.0, load_depth=True) # 1x
|
|
150
|
+
# ... you can use any rescale_factor as you want
|
|
151
|
+
|
|
152
|
+
# For camera-trainable scenarios
|
|
153
|
+
dataset = RescaleTrainableCameraDataset.from_colmap(source_path, rescale_factor=0.125, load_depth=True) # 8x
|
|
154
|
+
dataset = RescaleTrainableCameraDataset.from_colmap(source_path, rescale_factor=0.25, load_depth=True) # 4x
|
|
155
|
+
dataset = RescaleTrainableCameraDataset.from_colmap(source_path, rescale_factor=0.5, load_depth=True) # 2x
|
|
156
|
+
dataset = RescaleTrainableCameraDataset.from_colmap(source_path, rescale_factor=1.0, load_depth=True) # 1x
|
|
157
|
+
# ... you can use any rescale_factor as you want
|
|
158
|
+
|
|
159
|
+
# Load from saved JSON
|
|
160
|
+
dataset = RescaleTrainableCameraDataset.from_json(camera_json_path, rescale_factor=0.125, load_depth=True) # 8x
|
|
161
|
+
dataset = RescaleTrainableCameraDataset.from_json(camera_json_path, rescale_factor=0.25, load_depth=True) # 4x
|
|
162
|
+
dataset = RescaleTrainableCameraDataset.from_json(camera_json_path, rescale_factor=0.5, load_depth=True) # 2x
|
|
163
|
+
dataset = RescaleTrainableCameraDataset.from_json(camera_json_path, rescale_factor=1.0, load_depth=True) # 1x
|
|
164
|
+
# ... you can use any rescale_factor as you want
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### LapisGS Trainers
|
|
168
|
+
|
|
169
|
+
LapisGS provides specialized trainers with partial densification and opacity reset:
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
from lapisgs.trainer import LapisTrainer, DepthLapisTrainer, LapisCameraTrainer, DepthLapisCameraTrainer
|
|
173
|
+
|
|
174
|
+
# Basic LapisGS trainer
|
|
175
|
+
trainer = LapisTrainer(
|
|
176
|
+
gaussians,
|
|
177
|
+
scene_extent=dataset.scene_extent(),
|
|
178
|
+
# ... other parameters
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
# LapisGS trainer with depth regularization
|
|
182
|
+
trainer = DepthLapisTrainer(
|
|
183
|
+
gaussians,
|
|
184
|
+
scene_extent=dataset.scene_extent(),
|
|
185
|
+
# ... other parameters
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
# LapisGS trainer with camera optimization
|
|
189
|
+
trainer = LapisCameraTrainer(
|
|
190
|
+
gaussians,
|
|
191
|
+
scene_extent=dataset.scene_extent(),
|
|
192
|
+
dataset=dataset,
|
|
193
|
+
# ... other parameters
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
# LapisGS trainer with both depth and camera optimization
|
|
197
|
+
trainer = DepthLapisCameraTrainer(
|
|
198
|
+
gaussians,
|
|
199
|
+
scene_extent=dataset.scene_extent(),
|
|
200
|
+
dataset=dataset,
|
|
201
|
+
# ... other parameters
|
|
202
|
+
)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Training Pipeline
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
from lapisgs.prepare import prepare_dataset, prepare_trainer
|
|
209
|
+
from reduced_3dgs.prepare import prepare_gaussians
|
|
210
|
+
|
|
211
|
+
# Prepare components for training
|
|
212
|
+
dataset = prepare_dataset(
|
|
213
|
+
source=source_path,
|
|
214
|
+
device=device,
|
|
215
|
+
trainable_camera=True,
|
|
216
|
+
load_camera=camera_json_path,
|
|
217
|
+
rescale_factor=0.5
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
gaussians = prepare_gaussians(
|
|
221
|
+
sh_degree=3,
|
|
222
|
+
source=source_path,
|
|
223
|
+
device=device,
|
|
224
|
+
trainable_camera=True,
|
|
225
|
+
load_ply=foundation_ply_path
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
trainer = prepare_trainer(
|
|
229
|
+
gaussians=gaussians,
|
|
230
|
+
dataset=dataset,
|
|
231
|
+
mode="camera", # "base", "camera", "nodepth-base", "nodepth-camera"
|
|
232
|
+
trainable_camera=True,
|
|
233
|
+
load_ply=foundation_ply_path
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
# Training loop
|
|
237
|
+
for camera in dataset:
|
|
238
|
+
loss, out = trainer.step(camera)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### How to extract the enhanced layer
|
|
242
|
+
|
|
243
|
+
Note that \<scene\>_res1 is the highest resolution, and \<scene\>_res8 is the lowest resolution. The model is trained from the lowest resolution to the highest resolution. The model stored in the higher resolution folder contains not only the higher layer but also the lower layer(s).
|
|
244
|
+
|
|
245
|
+
We construct the merged GS with a specially designed order: the lower layers come first as the foundation base, and the enhanced layer is stiched behind the foundation base, as shown in the figure below. As the foundation base is frozen to optimization and adaptive control, one can easily extract the enhanced layer by performing the operation like GS[size_of_foundation_layers:].
|
|
246
|
+
|
|
247
|
+
<p align="center">
|
|
248
|
+
<a href="">
|
|
249
|
+
<img src="images/model_structure.png" alt="model_structure" width="70%">
|
|
250
|
+
</a>
|
|
251
|
+
</p>
|
|
252
|
+
|
|
253
|
+
### CUDA out-of-memory error
|
|
254
|
+
|
|
255
|
+
Through experiments, we found that the default loss function is not sensitive to low-resolution images, making optimization and desification failed. It is because in the default loss function, L1 loss is attached much more importance (0.8), but L1 loss is not sensitive to finer details, blurriness, or low-resolution artifacts. Therefore, the loss, computed from the default loss function, would be small at low layers, disabling the parameter update and adaptive control for the low-layer Gaussian splats. Therefore, we set lambda_dssim to 0.8 to emphasize the structural similarity loss, which is more sensitive to low-resolution artifacts and then causes much heavier desification, finally producing bigger 3DGS model.
|
|
256
|
+
|
|
257
|
+
To reduce the model size, you may try to 1) lower down the lambda_dssim, or 2) increase the densification threshold. Also, generally speaking, it is not necessary to make it SSIM-sensitive for complex scenes. For example, we note that training LapisGS for complex scene *playroom* with default lambda_dssim 0.2 can still produce reasonable layered structure, while it fails for simple object *lego*.
|
|
258
|
+
|
|
259
|
+
<div align="center">
|
|
260
|
+
<h1>
|
|
261
|
+
<img src="images/title.png" alt="icon" style="height: 1em; vertical-align: middle; margin-right: 0.1em;">
|
|
262
|
+
<strong>LapisGS: </strong>Layered Progressive 3D Gaussian Splatting for Adaptive Streaming
|
|
263
|
+
</h1>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<div align="center">
|
|
267
|
+
<a href="https://yuang-ian.github.io" target='_blank'>Yuang Shi</a><sup>1</sup>,
|
|
268
|
+
<a href="https://scholar.google.com/citations?user=PbKu-PsAAAAJ&hl=en" target='_blank'>Simone Gasparini</a><sup>2</sup>,
|
|
269
|
+
<a href="https://scholar.google.de/citations?user=H8QDhhAAAAAJ&hl=en" target='_blank'>Géraldine Morin</a><sup>2</sup>,
|
|
270
|
+
<a href="https://www.comp.nus.edu.sg/~ooiwt/" target='_blank'>Wei Tsang Ooi</a><sup>1</sup>,
|
|
271
|
+
<p>
|
|
272
|
+
<sup>1</sup>National University of Singapore,
|
|
273
|
+
<sup>2</sup>IRIT - Université de Toulouse
|
|
274
|
+
</p>
|
|
275
|
+
<p>
|
|
276
|
+
International Conference on 3D Vision (3DV), 2025
|
|
277
|
+
</p>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<div align="center">
|
|
282
|
+
<a href="http://arxiv.org/abs/2408.14823" target='_blank'>
|
|
283
|
+
<img src="https://img.shields.io/badge/Paper-%F0%9F%93%83-blue">
|
|
284
|
+
</a>
|
|
285
|
+
<a href="https://yuang-ian.github.io/lapisgs/" target='_blank'>
|
|
286
|
+
<img src="https://img.shields.io/badge/Project-%F0%9F%94%97-yellow">
|
|
287
|
+
</a>
|
|
288
|
+
</div> <br> <br>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
<p align="center">
|
|
293
|
+
<a href="">
|
|
294
|
+
<img src="images/teaser.png" alt="teaser" width="80%">
|
|
295
|
+
</a>
|
|
296
|
+
</p>
|
|
297
|
+
|
|
298
|
+
<p align="center">
|
|
299
|
+
We introduce <strong><i>LapisGS</i></strong>*, a layered progressive 3DGS, for adaptive streaming and view-adaptive rendering.
|
|
300
|
+
</p>
|
|
301
|
+
|
|
302
|
+
<p align="center">
|
|
303
|
+
<span class="small">
|
|
304
|
+
*<i>Lapis</i> means "layer" in Malay, the national language of Singapore --- the host of 3DV'25. The logo in the title depicts <a href="https://en.wikipedia.org/wiki/Kue_lapis">kuih lapis</a>, or "layered cake", a local delight in Singapore and neighboring countries. The authors are glad to serve kuih lapis to our friends at the conference to share the joy of the layered approach 🥳.
|
|
305
|
+
</span>
|
|
306
|
+
</p>
|
|
307
|
+
<br>
|
|
308
|
+
|
|
309
|
+
If you find our code or paper useful, please cite
|
|
310
|
+
|
|
311
|
+
```latex
|
|
312
|
+
@inproceedings{shi2024lapisgs,
|
|
313
|
+
author = {Shi, Yuang and Gasparini, Simone and Morin, Géraldine and Ooi, Wei Tsang},
|
|
314
|
+
title = {{LapisGS}: Layered Progressive {3D Gaussian} Splatting for Adaptive Streaming},
|
|
315
|
+
publisher = {{IEEE}},
|
|
316
|
+
booktitle = {International Conference on 3D Vision, 3DV 2025, Singapore, March 25-28, 2025},
|
|
317
|
+
year = {2025},
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Based on our LapisGS, we built the first ever dynamic 3DGS streaming system, which achieves superior performance in both live streaming and on-demand streaming. Our work is to be appeared in the MMSys'25 in March 2025. Access to the [Preprint Paper](https://drive.google.com/file/d/1iDz1ExOd1LrPhA7fv4DbLUbzn-Jioihn/view?usp=share_link).
|
|
322
|
+
|
|
323
|
+
```latex
|
|
324
|
+
@inproceedings{sun2025lts,
|
|
325
|
+
author = {Sun, Yuan-Chun and Shi, Yuang and Lee, Cheng-Tse and Zhu, Mufeng and Ooi, Wei Tsang and Liu, Yao and Huang, Chun-Ying and Hsu, Cheng-Hsin},
|
|
326
|
+
title = {{LTS}: A {DASH} Streaming System for Dynamic Multi-Layer {3D Gaussian} Splatting Scenes},
|
|
327
|
+
publisher = {{ACM}},
|
|
328
|
+
booktitle = {The 16th ACM Multimedia Systems Conference, MMSys 2025, 2025},
|
|
329
|
+
year = {2025},
|
|
330
|
+
}
|
|
331
|
+
```
|