PyMAF-X: Towards Well-aligned Full-body Model Regression from Monocular Images
Hongwen Zhang Β· Yating Tian Β· Yuxiang Zhang Β· Mengcheng Li Β· Liang An Β· Zhenan Sun Β· Yebin Liu
Project Page | Video | Paper
Frame by frame reconstruction. Video clipped from here.
Reconstruction result on a COCO validation image.
Click Here for More Results
Installation
- Python 3.8
conda create --no-default-packages -n pymafx python=3.8
conda activate pymafx
packages
- PyTorch tested on version 1.9.0
conda install pytorch==1.9.0 torchvision==0.10.0 cudatoolkit=11.1 -c pytorch -c conda-forge
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
- other packages listed in
requirements.txt
pip install -r requirements.txt
necessary files
smpl_downsampling.npz & mano_downsampling.npz
- Run the following script to fetch necessary files.
bash fetch_data.sh
SMPL & SMPL-X model files
- Collect SMPL and SMPL-X model files from https://smpl.is.tue.mpg.de and https://smpl-x.is.tue.mpg.de. Rename model files and put them into the
./data/smpldirectory.
Download the partial_mesh files and put it into the
./data/partial_meshdirectory.
Download the pre-trained model and put it into the
./data/pretrained_modeldirectory.
After collecting the above necessary files, the directory structure of ./data is expected as follows.
./data
βββ J_regressor_extra.npy
βββ smpl_mean_params.npz
βββ smpl_downsampling.npz
βββ mano_downsampling.npz
βββ partial_mesh
β βββ ***_vids.npz
βββ pretrained_model
β βββ PyMAF-X_model_checkpoint.pt
βββ smpl
βββ SMPLX_NEUTRAL.npz
βββ SMPL_NEUTRAL.pkl
βββ model_transfer
βββ smplx_to_smpl.pkl
Demo
You can first give it a try on Google Colab using the notebook we have prepared, which is no need to prepare the environment yourself:
Run the demo code.
For image folder input:
python -m apps.demo_smplx --image_folder new --detection_threshold 0.3 --pretrained_model data/pretrained_model/PyMAF-X_model_checkpoint.pt --misc TRAIN.BHF_MODE full_body MODEL.EVAL_MODE True MODEL.PyMAF.HAND_VIS_TH 0.1
For video input:
python -m apps.demo_smplx --vid_file examples/dancer_short.mp4 --pretrained_model data/pretrained_model/PyMAF-X_model_checkpoint.pt --misc TRAIN.BHF_MODE full_body MODEL.EVAL_MODE True MODEL.PyMAF.HAND_VIS_TH 0.1
Results will be saved at ./output. You can set different hyperparamters in the scripts, e.g., --detection_threshold for the person detection threshold and MODEL.PyMAF.HAND_VIS_TH for the hand visibility threshold.
Citation
If this work is helpful in your research, please cite the following papers.
@article{pymafx2022,
title={PyMAF-X: Towards Well-aligned Full-body Model Regression from Monocular Images},
author={Zhang, Hongwen and Tian, Yating and Zhang, Yuxiang and Li, Mengcheng and An, Liang and Sun, Zhenan and Liu, Yebin},
journal={arXiv preprint arXiv:2207.06400},
year={2022}
}
@inproceedings{pymaf2021,
title={PyMAF: 3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop},
author={Zhang, Hongwen and Tian, Yating and Zhou, Xinchi and Ouyang, Wanli and Liu, Yebin and Wang, Limin and Sun, Zhenan},
booktitle={Proceedings of the IEEE International Conference on Computer Vision},
year={2021}
}
Acknowledgments
Part of the code is borrowed from the following projects, including DaNet, SPIN, VIBE, SPEC, MeshGraphormer, PIFu, DensePose, HMR, HRNet, pose_resnet. Many thanks to their contributions.