当前位置:网站首页>Mtcnn face detection

Mtcnn face detection

2022-07-06 11:24:00 imxlw00

MTCNN Two tasks can be achieved —— Face detection and face key point detection .

MTCNN It's integrated into python Library .

install

Be careful : The following dependencies need to be confirmed before installation :

python >= 3.4
opencv >= 4.1
Keras>=2.0.0

pip install mtcnn

 Insert picture description here

Face detection

from mtcnn import MTCNN
import cv2
img=cv2.imread("../datas/face/ldh2.jpg")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
detector = MTCNN()
face =detector.detect_faces(img)
print(face)

[
{‘box’: [162, 72, 226, 281],
‘confidence’: 0.9999822378158569,
‘keypoints’: {‘left_eye’: (236, 190), ‘right_eye’: (335, 179), ‘nose’: (296, 248), ‘mouth_left’: (254, 291), ‘mouth_right’: (331, 282)}}
]

design sketch

 Insert picture description here

原网站

版权声明
本文为[imxlw00]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060912504338.html