diff --git a/README_cn.md b/README_cn.md index 85a56236942e53ff7441716bcfa0e09bfc7d85a7..c434b3bfd3abacc1e2e19f17f05f2eb2d0289554 100644 --- a/README_cn.md +++ b/README_cn.md @@ -236,7 +236,7 @@ PaddleDetection模块化地实现了多种主流目标检测算法,提供了 - [S2ANet](configs/dota/README.md) - [关键点检测](configs/keypoint) - HigherHRNet - - HRNeet + - HRNet - [多目标跟踪](configs/mot/README_cn.md) - [DeepSORT](configs/mot/deepsort/README_cn.md) - [JDE](configs/mot/jde/README_cn.md) diff --git a/README_en.md b/README_en.md index 8ccc834be84dd63e05a7dbf3ae944b5d5041e7f0..4cdb41d3fc1cba06f0cb07e264ddba1d4c9cedab 100644 --- a/README_en.md +++ b/README_en.md @@ -250,7 +250,7 @@ The relationship between COCO mAP and FPS on Tesla V100 of representative models - [S2ANet](configs/dota/README.md) - [Keypoint detection](configs/keypoint) - HigherHRNet - - HRNeet + - HRNet - [Multi-Object Tracking](configs/mot/README.md) - [DeepSORT](configs/mot/deepsort/README.md) - [JDE](configs/mot/jde/README.md) diff --git a/configs/keypoint/README.md b/configs/keypoint/README.md index e31e4420a30d95094060feaf3b78d827899d04e2..286fe64dcc0752a4040fbf49a9fbb850a2754716 100644 --- a/configs/keypoint/README.md +++ b/configs/keypoint/README.md @@ -35,14 +35,15 @@ MPII数据集 ### 1、环境安装 -​ 请参考PaddleDetection [安装文档](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/INSTALL_cn.md)正确安装PaddlePaddle和PaddleDetection即可 +​ 请参考PaddleDetection [安装文档](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/INSTALL_cn.md)正确安装PaddlePaddle和PaddleDetection即可。 ### 2、数据准备 -​ 目前KeyPoint模型基于coco数据集开发,其他数据集尚未验证 +​ 目前KeyPoint模型支持[COCO](https://cocodataset.org/#keypoints-2017)数据集和[MPII](http://human-pose.mpi-inf.mpg.de/#overview)数据集,数据集的准备方式请参考[关键点数据准备](../../docs/tutorials/PrepareKeypointDataSet_cn.md)。 + + + - 请注意,Top-Down方案使用检测框测试时,需要通过检测模型生成bbox.json文件。COCO val2017的检测结果可以参考[Detector having human AP of 56.4 on COCO val2017 dataset](https://paddledet.bj.bcebos.com/data/bbox.json),下载后放在根目录(PaddleDetection)下,然后修改config配置文件中`use_gt_bbox: False`后生效。然后正常执行测试命令即可。 -​ 请参考PaddleDetection[数据准备部分](https://github.com/PaddlePaddle/PaddleDetection/blob/f0a30f3ba6095ebfdc8fffb6d02766406afc438a/docs/tutorials/PrepareDataSet.md)部署准备COCO数据集即可 - 请注意,Top-Down方案使用检测框测试时,需要给予检测模型生成bbox.json文件,或者从网上[下载地址](https://paddledet.bj.bcebos.com/data/bbox.json)下载后放在根目录(PaddleDetection)下,然后修改config配置文件中use_gt_bbox: False后生效。然后正常执行测试命令即可。 ### 3、训练与测试 @@ -50,18 +51,27 @@ MPII数据集 ```shell CUDA_VISIBLE_DEVICES=0 python3 tools/train.py -c configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml + +#MPII DataSet +CUDA_VISIBLE_DEVICES=0 nohup python3 tools/train.py -c configs/keypoint/hrnet/hrnet_w32_256x256_mpii.yml ``` ​ **多卡训练:** ```shell CUDA_VISIBLE_DEVICES=0,1,2,3 python3 -m paddle.distributed.launch tools/train.py -c configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml + +#MPII DataSet +CUDA_VISIBLE_DEVICES=0,1,2,3 nohup python3 -m paddle.distributed.launch tools/train.py -c configs/keypoint/hrnet/hrnet_w32_256x256_mpii.yml ``` ​ **模型评估:** ```shell CUDA_VISIBLE_DEVICES=0 python3 tools/eval.py -c configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml + +#MPII DataSet +CUDA_VISIBLE_DEVICES=0 python3 tools/eval.py -c configs/keypoint/hrnet/hrnet_w32_256x256_mpii.yml ``` ​ **模型预测:** @@ -98,3 +108,36 @@ python deploy/python/mot_keypoint_unite_infer.py --mot_model_dir=output_inferenc ``` **注意:** 跟踪模型导出教程请参考`configs/mot/README.md`。 + + +## 引用 +``` +@inproceedings{cheng2020bottom, + title={HigherHRNet: Scale-Aware Representation Learning for Bottom-Up Human Pose Estimation}, + author={Bowen Cheng and Bin Xiao and Jingdong Wang and Honghui Shi and Thomas S. Huang and Lei Zhang}, + booktitle={CVPR}, + year={2020} +} + +@inproceedings{SunXLW19, + title={Deep High-Resolution Representation Learning for Human Pose Estimation}, + author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang}, + booktitle={CVPR}, + year={2019} +} + +@article{wang2019deep, + title={Deep High-Resolution Representation Learning for Visual Recognition}, + author={Wang, Jingdong and Sun, Ke and Cheng, Tianheng and Jiang, Borui and Deng, Chaorui and Zhao, Yang and Liu, Dong and Mu, Yadong and Tan, Mingkui and Wang, Xinggang and Liu, Wenyu and Xiao, Bin}, + journal={TPAMI}, + year={2019} +} + +@InProceedings{Zhang_2020_CVPR, + author = {Zhang, Feng and Zhu, Xiatian and Dai, Hanbin and Ye, Mao and Zhu, Ce}, + title = {Distribution-Aware Coordinate Representation for Human Pose Estimation}, + booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, + month = {June}, + year = {2020} +} +``` diff --git a/docs/tutorials/PrepareKeypointDataSet_cn.md b/docs/tutorials/PrepareKeypointDataSet_cn.md new file mode 100644 index 0000000000000000000000000000000000000000..a34de57bc35522c6821078f5acc0205923808b35 --- /dev/null +++ b/docs/tutorials/PrepareKeypointDataSet_cn.md @@ -0,0 +1,107 @@ +# 如何准备关键点数据集 +## 目录 +- [COCO数据集](#COCO数据集) +- [MPII数据集](#MPII数据集) + +## COCO数据集 +### COCO数据集的准备 +我们提供了一键脚本来自动完成COCO2017数据集的下载及准备工作,请参考[COCO数据集下载](https://github.com/PaddlePaddle/PaddleDetection/blob/f0a30f3ba6095ebfdc8fffb6d02766406afc438a/docs/tutorials/PrepareDataSet.md#COCO%E6%95%B0%E6%8D%AE)。 + +### COCO数据集(KeyPoint)说明 +在COCO中,关键点序号与部位的对应关系为: +``` +COCO keypoint indexes:: + 0: 'nose', + 1: 'left_eye', + 2: 'right_eye', + 3: 'left_ear', + 4: 'right_ear', + 5: 'left_shoulder', + 6: 'right_shoulder', + 7: 'left_elbow', + 8: 'right_elbow', + 9: 'left_wrist', + 10: 'right_wrist', + 11: 'left_hip', + 12: 'right_hip', + 13: 'left_knee', + 14: 'right_knee', + 15: 'left_ankle', + 16: 'right_ankle' +``` +与Detection任务不同,KeyPoint任务的标注文件为`person_keypoints_train2017.json`和`person_keypoints_val2017.json`两个json文件。json文件中包含的`info`、`licenses`和`images`字段的含义与Detection相同,而`annotations`和`categories`则是不同的。 +在`categories`字段中,除了给出类别,还给出了关键点的名称和互相之间的连接性。 +在`annotations`字段中,标注了每一个实例的ID与所在图像,同时还有分割信息和关键点信息。其中与关键点信息较为相关的有: +- `keypoints`:`[x1,y1,v1 ...]`,是一个长度为17*3=51的List,每组表示了一个关键点的坐标与可见性,`v=0, x=0, y=0`表示该点不可见且未标注,`v=1`表示该点有标注但不可见,`v=2`表示该点有标注且可见。 +- `bbox`: `[x1,y1,w,h]`表示该实例的检测框位置。 +- `num_keypoints`: 表示该实例标注关键点的数目。 + + +## MPII数据集 +### MPII数据集的准备 +请先通过[MPII Human Pose Dataset](http://human-pose.mpi-inf.mpg.de/#download)下载MPII数据集的图像与对应标注文件,并存放到`dataset/mpii`路径下。标注文件可以采用[mpii_annotations](https://download.openmmlab.com/mmpose/datasets/mpii_annotations.tar),已对应转换为json格式,完成后的目录结构为: +``` +mpii +|── annotations +| |── mpii_gt_val.mat +| |── mpii_test.json +| |── mpii_train.json +| |── mpii_trainval.json +| `── mpii_val.json +`── images + |── 000001163.jpg + |── 000003072.jpg +``` +### MPII数据集的说明 +在MPII中,关键点序号与部位的对应关系为: +``` +MPII keypoint indexes:: + 0: 'right_ankle', + 1: 'right_knee', + 2: 'right_hip', + 3: 'left_hip', + 4: 'left_knee', + 5: 'left_ankle', + 6: 'pelvis', + 7: 'thorax', + 8: 'upper_neck', + 9: 'head_top', + 10: 'right_wrist', + 11: 'right_elbow', + 12: 'right_shoulder', + 13: 'left_shoulder', + 14: 'left_elbow', + 15: 'left_wrist', +``` +下面以一个解析后的标注信息为例,说明标注的内容,其中每条标注信息标注了一个人物实例: +``` +{ + 'joints_vis': [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + 'joints': [ + [-1.0, -1.0], + [-1.0, -1.0], + [-1.0, -1.0], + [-1.0, -1.0], + [-1.0, -1.0], + [-1.0, -1.0], + [-1.0, -1.0], + [1232.0, 288.0], + [1236.1271, 311.7755], + [1181.8729, -0.77553], + [692.0, 464.0], + [902.0, 417.0], + [1059.0, 247.0], + [1405.0, 329.0], + [1498.0, 613.0], + [1303.0, 562.0] + ], + 'image': '077096718.jpg', + 'scale': 9.516749, + 'center': [1257.0, 297.0] +} +``` +- `joints_vis`:分别表示16个关键点是否标注,若为0,则对应序号的坐标也为`[-1.0, -1.0]`。 +- `joints`:分别表示16个关键点的坐标。 +- `image`:表示对应的图片文件。 +- `center`:表示人物的大致坐标,用于定位人物在图像中的位置。 +- `scale`:表示人物的比例,对应200px。 \ No newline at end of file