ingra14m/floater-free-gaussian-splatting

An unofficial implementation of absGS

Python

131

86 commits

updated Apr 21, 2024

See the code

README

Floater-Free-Gaussian-Splatting

This repo uses the absolute value of the gradient of pixel pairs for GS to accumulate the gradient of each GS. Since the preprint paper absGS did the same thing, therefore, you can also consider this repo as an unofficial implementation of absGS.

Compared to Pixel-GS, our project can achieve the removal of floaters without significantly increasing the number of GS. In some scenarios where the point cloud distribution is good, it can reduce the number of point clouds. Compared to Radsplat, our method does not require training zipnerf, and the training time on a 3090 is approximately 30 minutes.

Dataset

In this project, you can use:

And the data structure should be organized as follows:

data/
├── NeRF
│   ├── Chair/
│   ├── Drums/
│   ├── ...
├── NSVF
│   ├── Bike/
│   ├── Lifestyle/
│   ├── ...
├── Mip-360
│   ├── bicycle/
│   ├── bonsai/
│   ├── ...
├── tandt_db
│   ├── db/
│   │   ├── drjohnson/
│   │   ├── playroom/
│   ├── tandt/
│   │   ├── train/
│   │   ├── truck/

Run

Environment

git clone https://github.com/ingra14m/floater-free-gaussian-splatting --recursive
cd floater-free-gaussian-splatting

conda create -n abs-gaussian-env python=3.8
conda activate abs-gaussian-env

# install pytorch
pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

# install dependencies
pip install -r requirements.txt

Train

python train.py -s your/path/to/the/dataset -m your/path/to/save --eval

# Mip-360
python train.py -s your/path/to/the/dataset -m your/path/to/save --eval -r [2/4]

# Others
python train.py -s your/path/to/the/dataset -m your/path/to/save --eval

It should be noted that we adopted the same approach as ZipNeRF, Pixel-GS, and RadSplat, downsampling outdoor scenes (bicycle, garden, stump, flower, treehill) by 4 times and indoor scenes (bonsai, counter, kitchen, room) by 2 times.

Render

python render.py -m your/path/to/save --eval --skip_train

Render Video

python render.py -m your/path/to/save --eval --skip_train --skip_test --render_video

Metrics

python metrics.py -m your/path/to/save

Results

Mip360

ScenePSNRSSIMLPIPSMemFPS
bicycle25.820.79890.1656144166
bonsai32.410.95020.1608258170
counter29.220.91870.1687261125
garden27.950.87990.093497165
kitchen31.910.93510.108143499
room31.780.93310.1750416114
stump27.30.79760.18481043103
flower21.840.64950.2629888105
treehill22.390.64750.2697108787
Average27.850.83450.1765755104

https://github.com/ingra14m/robust-gaussian-splatting/assets/63096187/e0f34e5f-ee83-442b-86fc-422c57c40a6b

https://github.com/ingra14m/floater-free-gaussian-splatting/assets/63096187/52d99636-cc9c-4b57-aaf1-651759e7e4c7

https://github.com/ingra14m/floater-free-gaussian-splatting/assets/63096187/0b1b9687-d75e-4c69-bc98-34c37c56e86c

NeRF

ScenePSNRSSIMLPIPSMemFPS
chair35.690.98790.0103101219
drums26.330.9550.036374300
ficus35.540.9870.011748386
hotdog38.170.98570.018544331
lego36.40.98330.014861317
materials30.610.9610.035733444
mic36.730.99260.006339307
ship31.850.90610.099889212
Average33.920.96980.029261315

NSVF

ScenePSNRSSIMLPIPSMemFPS
Bike40.740.99390.005623459
Lifestyle33.210.97950.02740379
Palace39.050.98350.015674280
Robot39.240.99360.006753319
Spaceship36.780.99150.009622437
Steamtrain37.710.99330.00848267
Toad37.280.98530.0173102273
Wineholder32.710.9750.02564191
Average37.090.98690.014353326

Methods

Don't forget to install the new diff-gaussian-rasterization in diff-gaussian-rasterization-extentions. This pipeline supports pre-filter, depth visualization, and uses additional variables to store the contribution of each pixel to the GS gradient (the contribution should obviously be positive).

// vanilla gradients for densification
atomicAdd(&dL_dmean2D[global_id].x, dL_dG * dG_ddelx * ddelx_dx);
atomicAdd(&dL_dmean2D[global_id].y, dL_dG * dG_ddely * ddely_dy);

// abs gradients for densification
atomicAdd(&dL_dmean2D_densify[global_id].x, fabsf(dL_dG * dG_ddelx * ddelx_dx));
atomicAdd(&dL_dmean2D_densify[global_id].y, fabsf(dL_dG * dG_ddely * ddely_dy));

BibTex

This idea is the same as absGS and Gaussian Opacity Fields. The difference is that we have set the densify_grad_threshold to 0.0005, and all other parameters are used as in vanilla 3D-GS. If you find this project useful, please don't forget to cite these two awesome papers.

@article{ye2024absgs,
  title={AbsGS: Recovering Fine Details for 3D Gaussian Splatting},
  author={Ye, Zongxin and Li, Wenyu and Liu, Sidun and Qiao, Peng and Dou, Yong},
  journal={arXiv preprint arXiv:2404.10484},
  year={2024}
}

@article{Yu2024GOF,
  author    = {Yu, Zehao and Sattler, Torsten and Geiger, Andreas},
  title     = {Gaussian Opacity Fields: Efficient High-quality Compact Surface Reconstruction in Unbounded Scenes},
  journal   = {arXiv:2404.10772},
  year      = {2024},
}

ingra14m/floater-free-gaussian-splatting

An unofficial implementation of absGS

Python

131

86 commits

updated Apr 21, 2024

See the code

README

Floater-Free-Gaussian-Splatting

This repo uses the absolute value of the gradient of pixel pairs for GS to accumulate the gradient of each GS. Since the preprint paper absGS did the same thing, therefore, you can also consider this repo as an unofficial implementation of absGS.

Compared to Pixel-GS, our project can achieve the removal of floaters without significantly increasing the number of GS. In some scenarios where the point cloud distribution is good, it can reduce the number of point clouds. Compared to Radsplat, our method does not require training zipnerf, and the training time on a 3090 is approximately 30 minutes.

Dataset

In this project, you can use:

And the data structure should be organized as follows:

data/
├── NeRF
│   ├── Chair/
│   ├── Drums/
│   ├── ...
├── NSVF
│   ├── Bike/
│   ├── Lifestyle/
│   ├── ...
├── Mip-360
│   ├── bicycle/
│   ├── bonsai/
│   ├── ...
├── tandt_db
│   ├── db/
│   │   ├── drjohnson/
│   │   ├── playroom/
│   ├── tandt/
│   │   ├── train/
│   │   ├── truck/

Run

Environment

git clone https://github.com/ingra14m/floater-free-gaussian-splatting --recursive
cd floater-free-gaussian-splatting

conda create -n abs-gaussian-env python=3.8
conda activate abs-gaussian-env

# install pytorch
pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

# install dependencies
pip install -r requirements.txt

Train

python train.py -s your/path/to/the/dataset -m your/path/to/save --eval

# Mip-360
python train.py -s your/path/to/the/dataset -m your/path/to/save --eval -r [2/4]

# Others
python train.py -s your/path/to/the/dataset -m your/path/to/save --eval

It should be noted that we adopted the same approach as ZipNeRF, Pixel-GS, and RadSplat, downsampling outdoor scenes (bicycle, garden, stump, flower, treehill) by 4 times and indoor scenes (bonsai, counter, kitchen, room) by 2 times.

Render

python render.py -m your/path/to/save --eval --skip_train

Render Video

python render.py -m your/path/to/save --eval --skip_train --skip_test --render_video

Metrics

python metrics.py -m your/path/to/save

Results

Mip360

ScenePSNRSSIMLPIPSMemFPS
bicycle25.820.79890.1656144166
bonsai32.410.95020.1608258170
counter29.220.91870.1687261125
garden27.950.87990.093497165
kitchen31.910.93510.108143499
room31.780.93310.1750416114
stump27.30.79760.18481043103
flower21.840.64950.2629888105
treehill22.390.64750.2697108787
Average27.850.83450.1765755104

https://github.com/ingra14m/robust-gaussian-splatting/assets/63096187/e0f34e5f-ee83-442b-86fc-422c57c40a6b

https://github.com/ingra14m/floater-free-gaussian-splatting/assets/63096187/52d99636-cc9c-4b57-aaf1-651759e7e4c7

https://github.com/ingra14m/floater-free-gaussian-splatting/assets/63096187/0b1b9687-d75e-4c69-bc98-34c37c56e86c

NeRF

ScenePSNRSSIMLPIPSMemFPS
chair35.690.98790.0103101219
drums26.330.9550.036374300
ficus35.540.9870.011748386
hotdog38.170.98570.018544331
lego36.40.98330.014861317
materials30.610.9610.035733444
mic36.730.99260.006339307
ship31.850.90610.099889212
Average33.920.96980.029261315

NSVF

ScenePSNRSSIMLPIPSMemFPS
Bike40.740.99390.005623459
Lifestyle33.210.97950.02740379
Palace39.050.98350.015674280
Robot39.240.99360.006753319
Spaceship36.780.99150.009622437
Steamtrain37.710.99330.00848267
Toad37.280.98530.0173102273
Wineholder32.710.9750.02564191
Average37.090.98690.014353326

Methods

Don't forget to install the new diff-gaussian-rasterization in diff-gaussian-rasterization-extentions. This pipeline supports pre-filter, depth visualization, and uses additional variables to store the contribution of each pixel to the GS gradient (the contribution should obviously be positive).

// vanilla gradients for densification
atomicAdd(&dL_dmean2D[global_id].x, dL_dG * dG_ddelx * ddelx_dx);
atomicAdd(&dL_dmean2D[global_id].y, dL_dG * dG_ddely * ddely_dy);

// abs gradients for densification
atomicAdd(&dL_dmean2D_densify[global_id].x, fabsf(dL_dG * dG_ddelx * ddelx_dx));
atomicAdd(&dL_dmean2D_densify[global_id].y, fabsf(dL_dG * dG_ddely * ddely_dy));

BibTex

This idea is the same as absGS and Gaussian Opacity Fields. The difference is that we have set the densify_grad_threshold to 0.0005, and all other parameters are used as in vanilla 3D-GS. If you find this project useful, please don't forget to cite these two awesome papers.

@article{ye2024absgs,
  title={AbsGS: Recovering Fine Details for 3D Gaussian Splatting},
  author={Ye, Zongxin and Li, Wenyu and Liu, Sidun and Qiao, Peng and Dou, Yong},
  journal={arXiv preprint arXiv:2404.10484},
  year={2024}
}

@article{Yu2024GOF,
  author    = {Yu, Zehao and Sattler, Torsten and Geiger, Andreas},
  title     = {Gaussian Opacity Fields: Efficient High-quality Compact Surface Reconstruction in Unbounded Scenes},
  journal   = {arXiv:2404.10772},
  year      = {2024},
}

Languages

Python

100.0%