AbelHu / Keypoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

人体骨骼关键点

人体骨骼关节点对于描述人体姿态、预测人体行为至关重要,因此人体骨骼关节点检测是诸多计算机视觉任务的基础,例如动作分类、异常行为检测、以及自动驾驶等。

本代码库是如下论文的实现:

@InProceedings{cao2017realtime,
  title = {Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields},
  author = {Zhe Cao and Tomas Simon and Shih-En Wei and Yaser Sheikh},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year = {2017}
  }

依赖

数据集

使用 AI Challenger 2017 的人体骨骼关键点数据集,包含30万张图片,70万人。训练集:210,000 张,验证集:30,000 张,测试集 A:30,000 张,测试集 B:30,000 张。

每个人物的全部人体骨骼关键点共有14个,编号顺序如表所示,依次为:

1/右肩 2/右肘 3/右腕 4/左肩 5/左肘
6/左腕 7/右髋 8/右膝 9/右踝 10/左髋
11/左膝 12/左踝 13/头顶 14/脖子

image

下载点这里:人体骨骼关键点数据集,放在 data 目录下。

网络结构

image

用法

数据预处理

提取210,000 张训练图片和30,000 张验证图片:

$ python pre-process.py

部位置信图(Part Confidence Maps)

原图 部位置信图 部位
image image RShoulder
image image RElbow
image image RWrist
image image LShoulder
image image LElbow
image image LWrist
image image RHip
image image RKnee
image image RAnkle
image image LHip
image image LKnee
image image LAnkle
image image Head
image image Neck

部位亲和场(Part Affinity Fields)

原图 部位亲和场(dx) 部位亲和场(dy) 肢体
image image image Head->Neck
image image image Neck->RShoulder
image image image RShoulder->RElbow
image image image RElbow->RWrist
image image image Neck->LShoulder
image image image LShoulder->LElbow
image image image LElbow->LWrist
image image image RShoulder->RHip
image image image RHip->RKnee
image image image RKnee->RAnkle
image image image LShoulder->LHip
image image image LHip->LKnee
image image image LKnee->LAnkle
image image image Neck->RHip

右肩指向右肘的PAF例子: image

训练

$ python train.py

可视化训练过程,执行:

$ tensorboard --logdir path_to_current_dir/logs

演示

下载 预训练模型 放在 models 目录,然后执行:

$ python demo.py

鸣谢

本代码主要基于 @michalfaber 的代码库 keras_Realtime_Multi-Person_Pose_Estimation。

About

License:Apache License 2.0


Languages

Language:Python 100.0%