Overview

PCK是mpii使用的人体关键点估计评价标准,在coco之前,PCK一直是比较主流的metric,包括deepfashion,fashionAI等,都是使用的此标准。

PCK

PCK(Percentage of Correct Keypoints)定义为正确估计出关键点的比例,计算检测的关键点与其对应的groundtruth间的归一化距离小于设定阈值的比例(the percentage of detections that fall within a normalized distance of the ground truth)。
于是就有了PCK@0.5,也就是设定的阈值是0.5。
归一化距离是关键点预测值与人工标注值的欧式距离,进行人体尺度因子的归一化,MPII数据集是以当前人的头部直径作为尺度因子,即头部矩形框的左上点与右下点的欧式距离,使用此尺度因子的姿态估计指标也称PCKh。
需要注意的是PCK是针对于一个人joints的predict和gt,也就是说不存在多么预测结果与gt之前对应的问题,或者说这个对应问题在PCK计算之前就应该解决了,而PCK解决多人姿态估计时使用的方式是在人的维度上进行平均。
从下面的代码也可以看出,距离的计算是一一对应的,而多人的PCK就是求平均值。

code

from mmpose

def keypoint_pck_accuracy(pred, gt, mask, thr, normalize):"""Calculate the pose accuracy of PCK for each individual keypoint and theaveraged accuracy across all keypoints for coordinates.Note:PCK metric measures accuracy of the localization of the body joints.The distances between predicted positions and the ground-truth onesare typically normalized by the bounding box size.The threshold (thr) of the normalized distance is commonly setas 0.05, 0.1 or 0.2 etc.batch_size: Nnum_keypoints: KArgs:pred (np.ndarray[N, K, 2]): Predicted keypoint location.gt (np.ndarray[N, K, 2]): Groundtruth keypoint location.mask (np.ndarray[N, K]): Visibility of the target. False for invisiblejoints, and True for visible. Invisible joints will be ignored foraccuracy calculation.thr (float): Threshold of PCK calculation.normalize (np.ndarray[N, 2]): Normalization factor for H&W.Returns:tuple: A tuple containing keypoint accuracy.- acc (np.ndarray[K]): Accuracy of each keypoint.- avg_acc (float): Averaged accuracy across all keypoints.- cnt (int): Number of valid keypoints."""distances = _calc_distances(pred, gt, mask, normalize)acc = np.array([_distance_acc(d, thr) for d in distances])valid_acc = acc[acc >= 0]cnt = len(valid_acc)avg_acc = valid_acc.mean() if cnt > 0 else 0return acc, avg_acc, cntdef _calc_distances(preds, targets, mask, normalize):"""Calculate the normalized distances between preds and target.Note:batch_size: Nnum_keypoints: Kdimension of keypoints: D (normally, D=2 or D=3)Args:preds (np.ndarray[N, K, D]): Predicted keypoint location.targets (np.ndarray[N, K, D]): Groundtruth keypoint location.mask (np.ndarray[N, K]): Visibility of the target. False for invisiblejoints, and True for visible. Invisible joints will be ignored foraccuracy calculation.normalize (np.ndarray[N, D]): Typical value is heatmap_sizeReturns:np.ndarray[K, N]: The normalized distances.If target keypoints are missing, the distance is -1."""N, K, _ = preds.shapedistances = np.full((N, K), -1, dtype=np.float32)# handle invalid valuesnormalize[np.where(normalize <= 0)] = 1e6distances[mask] = np.linalg.norm(((preds - targets) / normalize[:, None, :])[mask], axis=-1)return distances.Tdef _distance_acc(distances, thr=0.5):"""Return the percentage below the distance threshold, while ignoringdistances values with -1.Note:batch_size: NArgs:distances (np.ndarray[N, ]): The normalized distances.thr (float): Threshold of the distances.Returns:float: Percentage of distances below the threshold.If all target keypoints are missing, return -1."""distance_valid = distances != -1num_distance_valid = distance_valid.sum()if num_distance_valid > 0:return (distances[distance_valid] < thr).sum() / num_distance_validreturn -1

MPII姿态估计性能评价标准-PCK相关推荐

  1. Human Pose Estimation人体姿态估计综述调研

    给定一幅图像或一段视频,人体姿态估计就是去恢复其中人体关节点位置的过程. 数据集 LSP 地址:http://sam.johnson.io/research/lsp.htm 样本数:2K 关节点个数: ...

  2. Human Pose Estimation姿态估计调研

    介绍 姿态估计的目标是在RGB图像或视频中描绘出人体的形状,这是一种多方面任务,其中包含了目标检测.姿态估计.分割等等.有些需要在非水平表面进行定位的应用可能也会用到姿态估计,例如图形.增强现实或者人 ...

  3. 单人人体姿态估计综述(转发)

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/Anymake_ren/article/details/81978260 </div>&l ...

  4. 姿态估计目标检测论文整理(1)

    一.姿态估计 1. 现阶段人体姿态识别主流的通常有2个思路: Top-Down(自上而下)方法:将人体检测和关键点检测分离,在图像上首先进行人体检测,找到所有的人体框,对每个人体框图再使用关键点检测, ...

  5. 【姿态估计】PCK(Percentage of Correct Keypoints)指标及代码实现

    PCK(Percentage of Correct Keypoints)指标及python代码实现 姿态估计任务中,常用的评价指标有AP值.PCK等. PCK指标定义 PCK指标指正确检测的关键点所占 ...

  6. 快速人体姿态估计:CVPR2019论文阅读

    快速人体姿态估计:CVPR2019论文阅读 Fast Human Pose Estimation 论文链接: http://openaccess.thecvf.com/content_CVPR_201 ...

  7. 人体姿态估计论文总结 (2D + 视频)

    2014:Learning Human Pose Estimation Features with Convolutional Networks, Jain etc, ICLR 2014 link: ...

  8. 经典论文复现 | PyraNet:基于特征金字塔网络的人体姿态估计

    过去几年发表于各大 AI 顶会论文提出的 400 多种算法中,公开算法代码的仅占 6%,其中三分之一的论文作者分享了测试数据,约 54% 的分享包含"伪代码".这是今年 AAAI ...

  9. 论文阅读笔记--Monocular Human Pose Estimation: A Survey of Deep Learning-based Methods 人体姿态估计综述

    趁着寒假有时间,把之前的论文补完,另外做了一点点笔记,也算是对论文的翻译,尝试探索一条适合自己的论文阅读方法. 这篇笔记基本按照原文的格式来,但是有些地方翻译成中文读起来不太顺,因此添加了一些自己的理 ...

最新文章

  1. 105. Leetcode 121. 买卖股票的最佳时机 (动态规划-股票交易)
  2. php curl安装检查,如何判断php的curl是否已安装
  3. zookeeper + kafka集群搭建详解
  4. 百度面试测试开发工程师内容
  5. linux tomcat 改端口号,Ubuntu中Tomcat更改80端口
  6. 分治——南蛮图腾(洛谷 P1498)
  7. Wireshark设置interface 时提示“There are no interfaces on which a capture can be done ”
  8. MySQL 在并发场景下会遇到的问题及解决方案~
  9. 一段python算法实战的代码
  10. 云优后台提交显示parsererror_Web测试必备技能——F12定位bug属于前端还是后台
  11. 超详细Java安装教程,小白速来!!!
  12. java8 64_【java8下载】Java8最新版下载 64位-七喜软件园
  13. oracle数据库论文参考文献,ORACLE数据库管理研究
  14. IIC总线设计⑥——时钟模块DS1302
  15. 迭代算法与递归算法的概念及区别
  16. BREDR之inquiry及page
  17. 今日头条有麻烦了!App 被下架
  18. Calendar获取日期所在周、月份第一天、最后一天以及前一周内所有时间
  19. java调用ltp_LTP随笔——本地调用ltp之ltp4j
  20. 把图片压缩成指定大小,释放你的内存空间

热门文章

  1. 【趣学算法】一棋盘的麦子
  2. 从零开始的python学习Day4
  3. FX5U编程常用特殊软元
  4. React报错:Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until y
  5. 以太坊:Web3.js 0.20 使用说明
  6. 判断南红价值,“红“的等级是关键
  7. ArcGIS中利用DEM数据生成地形图既视感的等高线;利用掩膜进行等高线注记;DEM的可视化表达总结
  8. j90度度复数运算_旋转,复数最直观的理解
  9. 以前写过的ajax基础案例(王欢-huanhuan)
  10. 7-1 递归实现逆序输出整数 (15 分)