deep-3dmask
deep-3dmask copied to clipboard
Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic Scenes", ICCV 2021.
Deep 3D Mask Volume for View Synthesis of Dynamic Scenes
Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic Scenes", ICCV 2021.
Kai-En Lin1, Lei Xiao2, Feng Liu2, Guowei Yang1, Ravi Ramamoorthi1
1University of California, San Diego, 2Facebook Reality Labs
Project Page | Paper | Supplementary Materials | Pretrained models | Dataset | Preprocessing script
Requirements
Install required packages
Make sure you have up-to-date NVIDIA drivers supporting CUDA 11.1 (10.2 could work but need to change cudatoolkit package accordingly)
Run
conda env create -f environments.yml
conda activate video_viewsynth
Usage
Rendering
-
Download our pretrained checkpoint and testing data. Extract the content to
[path_to_data_directory]. It containsframesandbackgroundfolders, as well asposes_bounds.npy. -
In
configs, setup data path by changingrender_video.txtroot_dirshould point to theframesfolder mentioned in 1. andbg_dirshould point tobackgroundfolder.out_dircan be your desired output folder.ckpt_pathshould be the pretrained checkpoint path. -
Run
python render_llff_video.py --config [config_file_path]e.g.
python render_llff_video.py --config ../configs/render_video.txt
-
(Optional) For your own data, please run
prepare_data.shsh render.sh [frame_folder] [starting_frame] [ending_frame] [output_folder_name]Make sure your data is in this structure before running
[frame_folder] --- cam00 --- 00000.jpg | |- 00001.jpg | ... |- cam01 |- cam02 ... |- poses_bounds.npye.g.
sh render.sh ~/deep_3d_data/frames 0 20 qual
Training
Train MPI
-
Download RealEstate10K dataset and extract the frames. There are scripts in
preprocessingfolder which can be used to generate the data.The order should be
download_data.py->extract_frames.py->compress_data.py.Remember to change the path in
compress_data.py. -
Change the paths in config file
train_realestate10k.txt -
Run
cd train_mpi python train.py --config ../configs/train_realestate10k.txt
Train Mask
Once MPI is trained, we can use the checkpoint to train 3D mask network.
-
Download dataset
-
Change the paths in config file
train_mask.txt -
Run
cd train_mask python train.py --config ../configs/train_mask.txt
Citation
@inproceedings {lin2021deep,
title = {Deep 3D Mask Volume for View Synthesis of Dynamic Scenes},
author = {Kai-En Lin and Lei Xiao and Feng Liu and Guowei Yang and Ravi Ramamoorthi},
booktitle = {ICCV},
year = {2021},
}