Liao Shen Tianqi Liu Huiqiang Sun Jiaqi Li Zhiguo Cao Wei Li✉ Chen Change Loy
CVPR 2025
- Clone the repository and create an environment.
git clone https://github.com/leoShen917/DoF-Gaussian.git --recursive
conda activate -n dofgs python=3.9
conda activate dofgs
- install pytorch and other dependencies.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
pip install submodules/
823E
diff-gaussian-rasterization
pip install -r requirements.txt
- We use COLMAP to calculate poses and sparse depths. However, original COLMAP does not have fusion mask for each view. Thus, we add masks to COLMAP and denote it as a submodule. Please follow https://colmap.github.io/install.html to install COLMAP in
./colmap
folder (Note that do not cover colmap folder with the original version).
Please download datasets at here. This dataset is originally produced by Deblur-NeRF. You can organize your own dataset as:
real_defocus_blur
│
└─── defocuscupcake
│ │
| └─── sparse
│ │
| └─── images_4
│ │
| └─── images
│ │
| └─── hold = 8
│
└─── defocuscups
│ │
......
Run Colmap
sh colmap.sh <path to dataset>
python train.py -s <path to dataset> -m <output folder> --eval -r <downsample_res> --llffhold <llffhold>
// ex. python train.py -s real_defocus_blur/defocuscupcake -m output/defocuscupcake --eval -r 4 --llffhold 8
To calculate metrics, namely PSNR, SSIM, and LPIPS, we could execute the following code:
python metric.py -m <output folder> -r <downsample_res>
If testing on Deblur-NeRF datasets, we should also add -t deblur-nerf
at the end of the code chunk above.
(coming soon)
We thank the authors of Gaussian Splatting, Mip-Splatting, RadeGS, DoF-NeRF, and the repos for their great works.
If you find our work useful in your research, please consider to cite our paper:
@article{shen2025dof,
title={DoF-Gaussian: Controllable Depth-of-Field for 3D Gaussian Splatting},
author={Shen, Liao and Liu, Tianqi and Sun, Huiqiang and Li, Jiaqi and Cao, Zhiguo and Li, Wei and Loy, Chen Change},
journal={arXiv preprint arXiv:2503.00746},
year={2025}
}