Skip to main content

face detector

Project description


face detector with landmarks, RetinaFace PyPI implement

reference :


pip3 install refinaface


#pip3 install opencv-python
import cv2 
from retinaface import RetinaFace

# init with normal accuracy option
detector = RetinaFace(quality="normal")

# same with cv2.imread,cv2.cvtColor 
rgb_image ="data/hian.jpg")

faces = detector.predict(rgb_image)
# faces is list of face dictionary
# each face dictionary contains x1 y1 x2 y2 left_eye right_eye nose left_lip right_lip
# faces=[{"x1":20,"y1":32, ... }, ...]

result_img = detector.draw(rgb_image,faces)

# save ([...,::-1] : rgb -> bgr )

# show using cv2
# cv2.imshow("result",result_img[...,::-1)
# cv2.waitKey()

result with drawing

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for retinaface, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size retinaface-0.0.6-py3-none-any.whl (5.9 MB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page