Home

Awesome

Compressing Volumetric Radiance Fields to 1 MB

Paper

Update: πŸ€— We update our compressed models in ModelScope, so you can test the models and render videos easily.

ζˆ‘δ»¬εœ¨ι­”ζ­δΈŠζ›΄ζ–°δΊ†εŽ‹ηΌ©εŽηš„ζ¨‘εž‹οΌŒζ›΄ζ–ΉδΎΏηš„ζ”―ζŒεœ¨ηΊΏζ΅‹θ―•ε’ŒζΈ²ζŸ“θ§†ι’‘γ€‚

compression

Pipeline

Note: This repository only contain VQ-TensoRF.

VQ-DVGO please refer to VQRF.

Setup

Please install the correct version of Pytorch and torch_scatter for your machine.

Directory structure for the datasets

<!-- <details> <summary> (click to expand;) </summary> -->
data
β”œβ”€β”€ nerf_synthetic     # Link: https://drive.google.com/drive/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1
β”‚   └── [chair|drums|ficus|hotdog|lego|materials|mic|ship]
β”‚       β”œβ”€β”€ [train|val|test]
β”‚       β”‚   └── r_*.png
β”‚       └── transforms_[train|val|test].json
β”‚
β”œβ”€β”€ Synthetic_NSVF     # Link: https://dl.fbaipublicfiles.com/nsvf/dataset/Synthetic_NSVF.zip
β”‚   └── [Bike|Lifestyle|Palace|Robot|Spaceship|Steamtrain|Toad|Wineholder]
β”‚       β”œβ”€β”€ intrinsics.txt
β”‚       β”œβ”€β”€ rgb
β”‚       β”‚   └── [0_train|1_val|2_test]_*.png
β”‚       └── pose
β”‚           └── [0_train|1_val|2_test]_*.txt
β”‚
β”œβ”€β”€ nerf_llff_data     # Link: https://drive.google.com/drive/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1
β”‚   └── [fern|flower|fortress|horns|leaves|orchids|room|trex]
β”‚    Β Β  β”œβ”€β”€ poses_bounds.npy
β”‚    Β Β  └── images
β”‚
└── TanksAndTemple     # Link: https://dl.fbaipublicfiles.com/nsvf/dataset/TanksAndTemple.zip
    └── [Barn|Caterpillar|Family|Ignatius|Truck]
        β”œβ”€β”€ intrinsics.txt
        β”œβ”€β”€ rgb
        β”‚   └── [0|1|2]_*.png
        └── pose
            └── [0|1|2]_*.txt
    
<!-- </details> -->

Training & VectQuantize & Testing

The training script is in vectquant.py.

For example, to train a VectQuantized model on the synthetic dataset:

python vectquant.py --config configs/vq/syn.txt --datadir {syn_dataset_dir}/hotdog --expname hotdog --basedir ./log_reimp/syn --render_path 0 --render_only 0 --ckpt ./log_reimp/syn/hotdog/hotdog.th

The process of the training script is divided into three steps:

More options refer to the opt.py.

Autotask for a dataset

python autotask_vq.py -g "0 1 2 3" --dataset {dataset_name} --suffix v0

Modify your data directory in DatasetSetting.

Set dataset_name, choices = ['syn', 'nsvf', 'tt', 'llff'].

Set -g option according to the availible gpus on your machine.

Notice: When you run the autotask script with multiple gpus, maybe the bottleneck is the disk IO for data loading.

Testing the VectQuantized model

python eval_vq_only.py --autotask --config configs/vq/syn.txt --datadir {syn_dataset_dir} --ckpt {VQ_model_checkpoint}

Acknowledgements

In this repository, we have used codes from the following repositories.

Citation

If you find our work useful in your research, please consider citing:

@inproceedings{li2023compressing,
  title={Compressing volumetric radiance fields to 1 mb},
  author={Li, Lingzhi and Shen, Zhen and Wang, Zhongshu and Shen, Li and Bo, Liefeng},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={4222--4231},
  year={2023}
}