New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

retinaface

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retinaface

face detector

1.1.1
PyPI
Maintainers
1

RetinaFace

face detector with landmarks, RetinaFace PyPI implement

reference : https://github.com/peteryuX/retinaface-tf2

Buy Me A Coffee

INSTALL

pip3 install refinaface

USEAGE


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

# init with 'normal' accuracy option (resize width or height to 800 )
# or you can choice 'speed' (resize to 320)
# or you can initiate with no parameter for running with original image size
detector = RetinaFace(quality="normal")

# same with cv2.imread,cv2.cvtColor 
rgb_image = detector.read("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 )
cv2.imwrite("data/result_img.jpg",result_img[...,::-1])

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

result with drawing

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts