---
title: cv_hrnet_face-2d-keypoint_keyposs
canonical_url: "https://www.modelscope.cn/models/jyhe21/cv_hrnet_face-2d-keypoint_keyposs"
md_url: "https://www.modelscope.cn/models/jyhe21/cv_hrnet_face-2d-keypoint_keyposs.md"
repository: jyhe21/cv_hrnet_face-2d-keypoint_keyposs
chinese_name: "KeyPoSS人脸关键点检测模型"
last_updated: 2023-09-17
license: "Apache License 2.0"
pipeline_tag: face-detection
tasks:
  - face-detection
library_name:
  - pytorch
frameworks:
  - pytorch
domain:
  - cv
downloads: 531
stars: 7
tags:
  - keyposs
---

# cv_hrnet_face-2d-keypoint_keyposs

> cv_hrnet_face-2d-keypoint_keyposs - jyhe21 在 ModelScope 开源的模型。KeyPosS是一种开创性的面部关键点检测系统，灵感来自GPS技术中的多点定位（True-Range Multilateration）算法。这种新方法解决了传统热图或坐标回归技术面临的编解码损失的挑战，提供了一种更高效、更准确的解决方案。

jyhe21/cv_hrnet_face-2d-keypoint_keyposs 是 ModelScope 魔搭社区上的face-detection模型，采用 Apache License 2.0 许可。

- **Repository**: jyhe21/cv_hrnet_face-2d-keypoint_keyposs
- **License**: Apache License 2.0
- **Tasks**: face-detection
- **Tags**: keyposs
- **Downloads**: 531
- **Stars**: 7
- **Last updated**: 2023-09-17

Source: https://www.modelscope.cn/models/jyhe21/cv_hrnet_face-2d-keypoint_keyposs

---

# KeyPosS: Plug-and-Play Facial Landmark Detection through GPS-Inspired True-Range Multilateration


## 模型描述
**KeyPosS** 是一款开创性的面部地标检测系统，灵感来自GPS技术中的多点定位算法（True-Range Multilateration）。这种新方法解决了传统热图或坐标回归技术面临的量化误差的挑战，提供了一种更高效、更准确的解决方案。如需更全面的了解和更多细节，请参阅我们的[ACM MM 2023论文](https://arxiv.org/abs/2305.16437)。

<!-- **KeyPosS** is a groundbreaking facial landmark detection system inspired by GPS technology, specifically the True-Range Multilateration algorithm. This novel approach addresses the challenges faced by traditional heatmap or coordinate regression-based techniques, offering a more efficient and accurate solution. For a more comprehensive understanding and additional details, please refer to our [ACM MM 2023 paper](https://arxiv.org/abs/2305.16437). -->

<div align="center">
  <img src='assert/error.png' width='900'/>
  <br>
  <i>图 1: 四种解码方法的比较。编码-解码中存在固有的“误差”.</i>
</div>


人脸关键点检测在从人脸识别到动画等各种应用中起着举足轻重的作用。然而，传统的方法往往面临着计算负担和量化误差方面的挑战。**KeyPosS**使用全卷积网络来预测距离图，计算兴趣点(POI)和多个锚点之间的距离。然后使用这些锚点对POI的位置进行三角测量，为面部关键点检测提供了一种独特而有效的方法。

<!-- Facial landmark detection plays a pivotal role in various applications, from face recognition to animation. Traditional methods, however, often face challenges in terms of computational burden and quantization errors. **KeyPosS** stands out by using a fully convolutional network to predict a distance map, which calculates the distance between a Point of Interest (POI) and multiple anchor points. These anchor points are then used to triangulate the POI's position, providing a unique and efficient approach to facial landmark detection. -->


<div align="center">
  <img src='assert/pipeline.png' width='900'/>
  <br>
  <i>图 2: KeyPosS方法，包括距离编码模型，站锚采样策略，和多点定位三个步骤。.</i>
</div>


## 期望的模型使用方式


### 1. 环境安装:

- **MMPose 安装**: 可以通过mmpose原有文档进行mmpose库安装 [mmpose](https://github.com/open-mmlab/mmpose).
  
- **Modelscope 安装**: ```shell pip install modelscope==1.8.0 ```

### 2. 示例代码

```python
import cv2
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.outputs import OutputKeys
import urllib
model_id = 'jyhe21/cv_hrnet_face-2d-keypoint_keyposs'
test_image = 'test.jpg'
urllib.request.urlretrieve('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/keypoints_detect/test_img_face_2d_keypoints.png', test_image)

# 初始化实时检测pipeline
keyposs = pipeline(
        Tasks.face_2d_keypoints, model=model_id, model_revision='v1.1.0')

# 进行实时检测 
result = keyposs(test_image)
if result:
    keypoints = result[OutputKeys.KEYPOINTS]
    print(keypoints)
else:
    raise ValueError('process error')
```


## 性能概览

<div align="center">
  <img src='assert/performance.png' width='900'/>
  <br>
  <i>表 1: 性能对比.</i>
</div>

## 致谢
KeyPosS是基于 [mmpose](https://github.com/open-mmlab/mmpose)进行开发的. 我们在此对mmpose的贡献表示感谢.

## Citation
如果这个工作对你有用,请引用以下文章:

```bibtex
@misc{bao2023keyposs,
      title={KeyPosS: Plug-and-Play Facial Landmark Detection through GPS-Inspired True-Range Multilateration}, 
      author={Xu Bao and Zhi-Qi Cheng and Jun-Yan He and Chenyang Li and Wangmeng Xiang and Jingdong Sun and Hanbing Liu and Wei Liu and Bin Luo and Yifeng Geng and Xuansong Xie},
      year={2023},
      eprint={2305.16437},
      primaryClass={cs.CV}
}
```
