This repository contains the code release for the CVPR 2025 paper: "FlexGS: Train Once, Deploy Everywhere with Many-in-One Flexible 3D Gaussian Splatting", which first enables elastic inference for Gaussian Splatting and achieves deployment to meet model size budget.
git clone --recursive https://github.com/LiuHengyu321/FlexGS.git
cd FlexGS
git submodule update --init --recursive
conda create -n flexgs python=3.10
conda activate flexgs
pip install -r requirements.txt
pip install -e submodules/compress-diff-gaussian-rasterization
pip install -e submodules/simple-knnWe use pytorch=1.13.1+cu121 as our experiment environment.
Our experiments are conducted on MipNeRF360, Zip-NeRF and Tank & Temple datasets.
Train FlexGS with the following scripts:
python train.py \
-s /path/to/dataset \
-m /path/to/ouput_dir \
--time_ratios 0.20 0.15 0.10 0.05 0.01 \
--configs ./arguments/flex.py \
--resolution 4 \
--gumbel_weight 1.0 \
--select_interval 1000 -s: path to the source data-m: output path--time_ratios: the given elastic ratios for training--configs: path to the config--resolution: resolution downscale of each image--gumbel_weight: weight of the Gumbel loss--select_interval: interval for updating the Global Importance
Render the image on the novel view at various elastic ratios.
python render.py \
--configs ./arguments/flex.py \
-m /path/to/ouput_dir \
--time_ratios 0.15 0.10 0.05 0.01 \-m: output path--time_ratios: the given elastic ratios for rendering--configs: path to the config--skip_video: skip rendering the video--skip_train: skip rendering the train views--skip_test: skip rendering the novel views
Metrics calculation: calculating the PSNR, SSIM and LPIPS for rendering results under all the given elastic ratios.
python metrics.py \
-m /path/to/ouput_dir \Our code is based on the following awesome repositories:
We thank the authors for releasing their code!
If you find our work useful for your projects, please consider citing the paper:
@inproceedings{liu2025flexgs,
title={FlexGS: Train Once, Deploy Everywhere with Many-in-One Flexible 3D Gaussian Splatting},
author={Liu, Hengyu and Wang, Yuehao and Li, Chenxin and Cai, Ruisi and Wang, Kevin and Li, Wuyang and Molchanov, Pavlo and Wang, Peihao and Wang, Zhangyang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year={2025}
}