Official code release for CVPR 2023 paper Learning Locally Editable Virtual Humans.
If you find our code, dataset, and paper useful, please cite as
@inproceedings{ho2023custom,
title={Learning Locally Editable Virtual Humans},
author={Ho, Hsuan-I and Xue, Lixin and Song, Jie and Hilliges, Otmar},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2023}
}
Our code has been tested with PyTorch 1.11.0, CUDA 11.3, and an RTX 3090 GPU.
pip install -r requirements.txt
-
Download and put the checkpoint file into the
checkpoints
folder. -
Download the test meshes and images from here and put them into the
data
folder. -
Run a quick demo on fitting to the unseen 3D scan and 2D images.
python demo.py --pretrained-root checkpoints/demo --model-name model-1000.pth
You should be able to wear me a Doge T-shirt.
- Try out different functions such as reposing and cloth transfer in
demo.py
.
Apply our dataset by sending a request. After downloading, you should get 646 textured meshes and SMPL-X meshes. We use only 100 meshes for training. We provide the indices of training meshes here.
- Prepare the training data following the folder structure:
training_dataset
├── 0003
│ ├── mesh-f00101.obj
│ ├── mesh-f00101.mtl
│ ├── mesh-f00101.png
│ ├── mesh-f00101.json
│ └── mesh-f00101_smpl.obj
├── 0007
│ ...
You can use the following script to generate the training dataset folder:
python tools/prepare_dataset.py
- Download SMPL-X models and move them to the
smplx
folder. You should have the following data structure:
smplx
├── SMPLX_NEUTRAL.pkl
├── SMPLX_NEUTRAL.npz
├── SMPLX_MALE.pkl
├── SMPLX_MALE.npz
├── SMPLX_FEMALE.pkl
└── SMPLX_FEMALE.npz
- Since online sampling points on meshes during training can be slow, we sample 18M points per mesh and cache them in an h5 file for training. Run the following script to generate the h5 file.
python generate_dataset.py -i /path/to/dataset/folder
NUM_SAMPLES
parameter here.
We also train our model using 150 scans in Thuman2.0 and you can find their indices here. Please apply for the dataset and SMPL-X registrations through their official repo.
flat_hand_mean=False
in the generate_dataset.py
script.
Once your h5 dataset is ready, simply run the command to train the model.
python train.py
Here are some configuration flags you can use, they will override the setting in config.yaml
--config
: path to the config file. Default isconfig.yaml
--wandb
: we use wandb for monitoring the training. Activate this flag if you want to use it.--save-root
: path to the folder to save the checkpoints. Default ischeckpoints
--data_root
: path to the training h5 dataset. Default isCustomHumans.h5
--use_2d_from_epoch
: use 2D adversarial loss after this epoch. -1 means never use 2D loss. Default is 10.
We use SIZER to evaluate the geometry fitting performance. Please follow the instructions to download their dataset.
We provide subjets' indices and scripts for evaluation.
We have used codes from other great research work, including gdna, kaolin-wisp, SMPL-X, ML-GSN, StyleGAN-Ada, Occupancy Networks.
We create all the videos using powerful aitviewer.
We sincerely thank the authors for their awesome work!