|
1 | 1 | # GoMAvatar: Efficient Animatable Human Modeling from Monocular Video Using Gaussians-on-Mesh
|
| 2 | + |
| 3 | +CVPR 2024 |
| 4 | + |
| 5 | +[Paper]() | [Project Page](https://wenj.github.io/GoMAvatar/) |
| 6 | + |
| 7 | +```bibtex |
| 8 | +@inproceedings{wen2024gomavatar, |
| 9 | + title={{GoMAvatar: Efficient Animatable Human Modeling from Monocular Video Using Gaussians-on-Mesh}}, |
| 10 | + author={Jing Wen and Xiaoming Zhao and Zhongzheng Ren and Alex Schwing and Shenlong Wang}, |
| 11 | + booktitle={CVPR}, |
| 12 | + year={2024} |
| 13 | +} |
| 14 | +``` |
| 15 | + |
| 16 | +## Requirements |
| 17 | + |
| 18 | +Our codes are tested in |
| 19 | +* CUDA 11.6 |
| 20 | +* PyTorch 1.13.0 |
| 21 | +* PyTorch3D 0.7.0 |
| 22 | + |
| 23 | +Install the required packages: |
| 24 | +```Shell |
| 25 | +conda create -n GoMAvatar |
| 26 | +conda activate GoMAvatar |
| 27 | + |
| 28 | +conda install pytorch==1.13.0 torchvision==0.14.0 pytorch-cuda=11.6 -c pytorch -c nvidia |
| 29 | +pip install -r requirements.txt |
| 30 | + |
| 31 | +# install pytorch3d |
| 32 | +conda install -c fvcore -c iopath -c conda-forge fvcore iopath |
| 33 | +conda install pytorch3d -c pytorch3d |
| 34 | + |
| 35 | +# install gaussian splatting |
| 36 | +pip install git+"https://github.com/graphdeco-inria/diff-gaussian-rasterization" |
| 37 | +``` |
| 38 | + |
| 39 | +## Data preparation |
| 40 | +### Prerequisites |
| 41 | +Download SMPL v1.0.0 models from [here](https://smpl.is.tue.mpg.de/download.php) and put the `.pkl` files under `utils/smpl/models`. |
| 42 | +You may need to remove the Chumpy objects following [here](https://github.com/vchoutas/smplx/tree/main/tools). |
| 43 | + |
| 44 | +### ZJU-MoCap |
| 45 | + |
| 46 | +First download the [ZJU-MoCap](https://github.com/zju3dv/neuralbody/blob/master/INSTALL.md#zju-mocap-dataset) dataset and save the raw data under `data/zju-mocap`. |
| 47 | + |
| 48 | +Run the following script to preprocess the dataset: |
| 49 | +```Shell |
| 50 | +cd scripts/prepare_zju-mocap |
| 51 | +python prepare_dataset.py --cfg "$SCENE".yaml |
| 52 | +``` |
| 53 | +Change `$SCENE` to one of 377, 386, 387, 392, 393, 394. |
| 54 | + |
| 55 | +The folder will be in the following structure: |
| 56 | +```Shell |
| 57 | +├── data |
| 58 | + ├── zju-mocap |
| 59 | + ├── 377 |
| 60 | + ├── 386 |
| 61 | + ├── ... |
| 62 | + ├── CoreView_377 |
| 63 | + ├── CoreView_386 |
| 64 | + ├── ... |
| 65 | +``` |
| 66 | +Folders named after scene ID only are preprocessed training data, while those prefixed with `CoreView_` are raw data. |
| 67 | + |
| 68 | +### PeopleSnapshot |
| 69 | + |
| 70 | +Download the [PeopleSnapshot](https://graphics.tu-bs.de/people-snapshot) dataset and save the files under `data/snapshot`. |
| 71 | + |
| 72 | +Download the refined training poses from [here](https://github.com/tijiang13/InstantAvatar/tree/master/data/PeopleSnapshot). |
| 73 | + |
| 74 | +Run the following script to preprocess the training and test set. |
| 75 | +```Shell |
| 76 | +cd scripts/prepare_snapshot |
| 77 | +python prepare_dataset.py --cfg "$SCENE".yaml # training set |
| 78 | +python prepare_dataset.py --cfg "$SCENE"_test.yaml # test set |
| 79 | +``` |
| 80 | +`$SCENE` is one of `female-3-casual`, `female-4-casual`, `male-3-casual` and `male-4-casual`. |
| 81 | + |
| 82 | +After the preprocessing, the folder will be in the following structure: |
| 83 | +```Shell |
| 84 | +├── data |
| 85 | + ├── snapshot |
| 86 | + ├── f3c_train |
| 87 | + ├── f3c_test |
| 88 | + ├── f4c_train |
| 89 | + ├── f4c_test |
| 90 | + ├── ... |
| 91 | + ├── female-3-casual |
| 92 | + ├── female-4-casual |
| 93 | + ├── ... |
| 94 | + ├── poses # refined training poses |
| 95 | + ├── female-3-casual |
| 96 | + ├── poses |
| 97 | + ├── anim_nerf_test.npz |
| 98 | + ├── anim_nerf_train.npz |
| 99 | + ├── anim_nerf_val.npz |
| 100 | + ├── ... |
| 101 | + |
| 102 | +``` |
| 103 | +Folders ended with `_train` or `_test` are preprocessed data. |
| 104 | + |
| 105 | +## Rendering and evaluation |
| 106 | + |
| 107 | +We provide the pretrained checkpoints in this [link](https://uofi.box.com/s/onwfp29ej03sr2ci7mm59nu74v6i0ip3). To reproduce the rendering results in the paper, run |
| 108 | +```Shell |
| 109 | +# ZJU-MoCap novel view synthesis |
| 110 | +python eval.py --cfg exps/zju-mocap_"$SCENE".yaml --type view |
| 111 | + |
| 112 | +# ZJU-MoCap novel pose synthesis |
| 113 | +python eval.py --cfg exps/zju-mocap_"$SCENE".yaml --type pose |
| 114 | +``` |
| 115 | +On the PeopleSnapshot dataset, we follow [Anim-NeRF](https://github.com/JanaldoChen/Anim-NeRF) and [InstantAvatar](https://github.com/tijiang13/InstantAvatar) to refine test poses: |
| 116 | +```Shell |
| 117 | +python train_pose.py --cfg exps/snapshot_"$SCENE".yaml |
| 118 | +``` |
| 119 | +Please check `exps/` for detailed configuration files. |
| 120 | + |
| 121 | +You can run 360 degree freeview rendering using the following command |
| 122 | +```Shell |
| 123 | +python eval.py --cfg exps/zju-mocap_"$SCENE".yaml --type freeview |
| 124 | +``` |
| 125 | +Use `--frame_idx` to specify the training frame id and `--n_frames` to set the number of views. |
| 126 | + |
| 127 | +Or you can render novel poses from [MDM](https://guytevet.github.io/mdm-page/): |
| 128 | +```Shell |
| 129 | +python eval.py --cfg exps/zju-mocap_"$SCENE".yaml --type pose_mdm --pose_path data/mdm_poses/sample.npy |
| 130 | +``` |
| 131 | +We provide an example of pose trajectory in `data/pose_mdm/sample.npy`. |
| 132 | + |
| 133 | +## Training |
| 134 | + |
| 135 | +Run the following command to train from scratch: |
| 136 | +```Shell |
| 137 | +# ZJU-MoCap |
| 138 | +python train.py --cfg exps/zju-mocap_"$SCENE".yaml |
| 139 | + |
| 140 | +# PeopleSnapshot |
| 141 | +python train.py --cfg exps/snapshot_"$SCENE".yaml |
| 142 | +``` |
| 143 | + |
| 144 | +## Acknowledgements |
| 145 | + |
| 146 | +This project builds upon [HumanNeRF](https://github.com/chungyiweng/humannerf) and [MonoHuman](https://github.com/Yzmblog/MonoHuman/tree/main). We appreciate the authors for their great work! |
0 commit comments