
稳定调用及效果更好的API,详见视觉开放智能平台:人脸检测与五官定位。
人脸检测关键点模型MTCNN
MTCNN是工业界广泛应用的检测关键点二合一模型, (论文地址, 代码地址),该方法包含下面4个模块:
MTCNN的结构如下:


本模型可以检测输入图片中人脸和对应5点关键点的位置。
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
mtcnn_face_detection = pipeline(Tasks.face_detection, 'damo/cv_manual_face-detection_mtcnn')
img_path = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/mtcnn_face_detection.jpg'
result = mtcnn_face_detection(img_path)
print('face detection output: {}.'.format(result))
# if you want to show the result, you can run
from modelscope.utils.cv.image_utils import draw_face_detection_result
from modelscope.preprocessors.image import LoadImage
import cv2
img = LoadImage.convert_to_ndarray(img_path)
cv2.imwrite('srcImg.jpg', img)
img_draw = draw_face_detection_result('srcImg.jpg', result)
cv2.imwrite('result.jpg', img_draw)
import matplotlib.pyplot as plt
plt.imshow(img_draw)
模型在WiderFace的验证集上客观指标如下:
| Method | Easy | Medium | Hard |
|---|---|---|---|
| MTCNN | 85.1 | 82.0 | 60.7 |
以下是ModelScope上人脸相关模型:
| 序号 | 模型名称 |
|---|---|
| 1 | RetinaFace人脸检测模型 |
| 2 | MogFace人脸检测模型-large |
| 3 | TinyMog人脸检测器-tiny |
| 4 | ULFD人脸检测模型-tiny |
| 5 | Mtcnn人脸检测关键点模型 |
| 6 | ULFD人脸检测模型-tiny |
| 序号 | 模型名称 |
|---|---|
| 1 | 口罩人脸识别模型FaceMask |
| 2 | 口罩人脸识别模型FRFM-large |
| 3 | IR人脸识别模型FRIR |
| 4 | ArcFace人脸识别模型 |
| 5 | IR人脸识别模型FRIR |
| 序号 | 模型名称 |
|---|---|
| 1 | 人脸活体检测模型-IR |
| 2 | 人脸活体检测模型-RGB |
| 3 | 静默人脸活体检测模型-炫彩 |
| 序号 | 模型名称 |
|---|---|
| 1 | FLCM人脸关键点置信度模型 |
| 序号 | 模型名称 |
|---|---|
| 1 | 人脸表情识别模型FER |
| 2 | 人脸属性识别模型FairFace |
本模型及代码来自开源社区(地址),请遵守相关许可。
如果你觉得这个该模型对有所帮助,请考虑引用下面的相关的论文:
@inproceedings{xiang2017joint,
title={Joint face detection and facial expression recognition with MTCNN},
author={Xiang, Jia and Zhu, Gengming},
booktitle={2017 4th international conference on information science and control engineering (ICISCE)},
pages={424--427},
year={2017},
organization={IEEE}
}