Home

Awesome

<div align="center"> <p align="center"> <img src="resources/logo.png" width="100px"> </p> <h2>Effective Whole-body Pose Estimation with Two-stages Distillation </h2>

<a href='https://arxiv.org/abs/2307.15880'><img src='https://img.shields.io/badge/ArXiv-2307.15880-red'></a>

PWC

Zhendong Yang, Ailing Zeng, Chun Yuan, Yu Li

<img src="resources/lalaland.gif" style="height:200px" /> <img src="resources/iron.gif" style="height:200px" />

<p>&emsp; &emsp; &emsp; &emsp; &emsp; DWPose &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp;&emsp; &emsp; &emsp; DWPose + ControlNet (<i>prompt: Ironman</i>) </p> </div>

πŸ’ƒπŸ» DWPose πŸ’ƒπŸ»

This repository is the official implementation of the Effective Whole-body Pose Estimation with Two-stages Distillation (ICCV 2023, CV4Metaverse Workshop). Our code is based on MMPose and ControlNet.

<p align="center"><img src="resources/architecture.jpg" width="650px"/>

βš”οΈ We release a series of models named DWPose with different sizes, from tiny to large, for human whole-body pose estimation. Besides, we also replace Openpose with DWPose for ControlNet, obtaining better Generated Images.

πŸ”₯ News

<p align="center"><img src="resources/demo.png" width="800px">

🐟 Installation

See installation instructions.

πŸš€ Results and Models

😎 DWPose on COCO. We release a series of DWPose models.

<p align="center"><img src="resources/compare.jpg" width="350px"/>

Results on COCO-WholeBody v1.0 val with detector having human AP of 56.4 on COCO val2017 dataset

ArchInput SizeFLOPS (G)Body APFoot APFace APHand APWhole APckptckpt
DWPose-t256x1920.50.5850.4650.7350.3570.485baidu drivegoogle drive
DWPose-s256x1920.90.6330.5330.7760.4270.538baidu drivegoogle drive
DWPose-m256x1922.20.6850.6360.8280.5270.606baidu drivegoogle drive
DWPose-l256x1924.50.7040.6620.8430.5660.631baidu drivegoogle drive
DWPose-l384x28810.10.7220.7040.8870.6210.665baidu drivegoogle drive

🦈 DWPose for ControlNet.

First, you need to download our SOTA model DWPose-l_384x288 and put it into ControlNet-v1-1-nightly/annotator/ckpts. Then you can use DWPose to generate the images you like.

cd ControlNet-v1-1-nightly
python gradio_dw_open_pose.py

Non-cherry-picked test with random seed 12345 ("spider man"):

<p align="center"><img src="resources/jay_pose.jpg" width="600px"/>

Comparison with OpenPose

<p align="center"><img src="resources/generation.jpg" width="600px"/>

🚒 Datasets

Prepare COCO in mmpose/data/coco and UBody in mmpose/data/UBody.

UBody needs to be tarnsferred into images. Don't forget.

cd mmpose
python video2image.py

If you want to evaluate the models on UBody

# add category into UBody's annotation
cd mmpose
python add_cat.py

⭐Train a model

Train DWPose with the first stage distillation

cd mmpose
bash tools/dist_train.sh configs/distiller/ubody/s1_dis/rtmpose_x_dis_l__coco-ubody-256x192.py 8

Train DWPose with the second stage distillation

cd mmpose
bash tools/dist_train.sh configs/distiller/ubody/s2_dis/dwpose_l-ll__coco-ubody-256x192.py 8

Tansfer the distillation models into regular models

cd mmpose
# if first stage distillation
python pth_transfer.py $dis_ckpt $new_pose_ckpt
# if second stage distillation
python pth_transfer.py $dis_ckpt $new_pose_ckpt --two_dis

⭐Test a model

# test on UBody
bash tools/dist_test.sh configs/wholebody_2d_keypoint/rtmpose/ubody/rtmpose-l_8xb64-270e_ubody-wholebody-256x192.py $pose_ckpt 8

# test on COCO
bash tools/dist_test.sh configs/wholebody_2d_keypoint/rtmpose/ubody/rtmpose-l_8xb64-270e_coco-ubody-wholebody-256x192.py $pose_ckpt 8

πŸ₯³ Citation

@article{yang2023effective,
  title={Effective Whole-body Pose Estimation with Two-stages Distillation},
  author={Yang, Zhendong and Zeng, Ailing and Yuan, Chun and Li, Yu},
  journal={arXiv preprint arXiv:2307.15880},
  year={2023}
}

πŸ₯‚ Acknowledgement

Our code is based on MMPose and ControlNet.