This repo is also linked to megvii-cpn
This is a Tensorflow re-implementation of CPN (Cascaded Pyramid Network), which wins 2017 COCO Keypoints Challenge. The original repo is based on the inner deep learning framework (MegBrain) in Megvii Inc.
Note that our testing code is based on some detectors. In COCO minival dataset, the used detector here achieves an AP of 41.1 whose human AP is 55.3 in COCO minival dataset.
Here we use the strong detector that achieves an AP of 44.5 whose human AP is 57.2 in COCO test-dev dataset.
For reference, by using the detection results given by MegDet that achieves an AP of 52.1 whose human AP is 62.9, human pose result is as followed.
Clone the repository
git clone https://github.com/chenyilun95/tf-cpn.git
We'll call the directory that you cloned $CPN_ROOT.
Download MSCOCO images from http://cocodataset.org/#download. We train in COCO trainvalminusminival dataset and validate in minival dataset. Then put the data and evaluation PythonAPI in $CPN_ROOT/data/COCO/MSCOCO. All paths are defined in config.py and you can modify them as you wish.
Download the base model (ResNet) weights from slim model_zoo and put them in $CPN_ROOT/data/imagenet_weights/.
Setup your environment by first running
pip3 install -r requirement.txt
To train a CPN model, use network.py in the model folder.
python3 network.py -d 0-1
After the training finished, output is written underneath $CPN_ROOT/log/ which looks like below
log/
|->model_dump/
| |->snapshot_1.ckpt.data-00000-of-00001
| |->snapshot_1.ckpt.index
| |->snapshot_1.ckpt.meta
| |->...
|->train_logs.txt
Run the testing code in the model folder.
python3 mptest.py -d 0-1 -r 350
This assumes there is an models that has been trained for 350 epochs. If you just want to specify a pre-trained model path, it's fine to run
python3 mptest.py -d 0-1 -m log/model_dump/snapshot_350.ckpt
Here we provide the human detection boxes results:
Person detection results in COCO Minival
Person detection results in COCO test-dev
Pre-trained models:
If you find CPN useful in your research, please consider citing:
@article{Chen2018CPN,
Author = {Chen, Yilun and Wang, Zhicheng and Peng, Yuxiang and Zhang, Zhiqiang and Yu, Gang and Sun, Jian},
Title = {{Cascaded Pyramid Network for Multi-Person Pose Estimation}},
Conference = {CVPR},
Year = {2018}
}
You may also be interested in the following papers:
MSPN:
@article{li2019rethinking,
title={Rethinking on Multi-Stage Networks for Human Pose Estimation},
author={Li, Wenbo and Wang, Zhicheng and Yin, Binyi and Peng, Qixiang and Du, Yuming and Xiao, Tianzi and Yu, Gang and Lu, Hongtao and Wei, Yichen and Sun, Jian},
journal={arXiv preprint arXiv:1901.00148},
year={2019}
}
RSN:
@misc{cai2020learning,
title={Learning Delicate Local Representations for Multi-Person Pose Estimation},
author={Yuanhao Cai and Zhicheng Wang and Zhengxiong Luo and Binyi Yin and Angang Du and Haoqian Wang and Xinyu Zhou and Erjin Zhou and Xiangyu Zhang and Jian Sun},
year={2020},
eprint={2003.04030},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Thanks for Geng David and his pytorch re-implementation of CPN.
If you have any questions about this repo, please feel free to contact chenyilun95@gmail.com.