Yolov5 Face Detection
Description
The project is a wrap over yolov5-face repo. Made simple portable interface for model import and inference. Model detects faces on images and returns bounding boxes and coordinates of 5 facial keypoints, which can be used for face alignment.
Installation
pip install yolov5facedetector
Usage example
from yolov5facedetector.face_detector import YoloDetector
import numpy as np
from PIL import Image
model = YoloDetector(target_size=720,gpu=0,min_face=90)
rgb_array_img = np.array(Image.open('test_image.jpg')) # Will make RGB Numpy Array Image
bboxes, confs, points = model.predict(rgb_array_img)
You can also pass several images packed in a list to get multi-image predictions.
bboxes, confs, points = model.predict([image1,image2])
Other pretrained models
Currently Support YOLOv5 type n,m & l type of model from yolov5-face repo. Default model type is 'yolov5n' but you can change to m & l (larger model version) which is auto download when first time used
Example below:
model = YoloFace(yolo_type='yolov5l',target_size=720) # Will download weight file automatically
bboxes, confs, points = model.predict(rgb_array_img)
Result example
Citiation
Thanks to deepcam-cn for pretrained models and Rebrikov Artem for providing wrapper function of YOLOv5Face.
Release files for yolov5facedetector 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yolov5facedetector-1.0.2.tar.gz | 164.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yolov5facedetector-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 267.0 kB
Release files / yolov5facedetector-1.0.2.tar.gz
| Download URL | yolov5facedetector-1.0.2.tar.gz |
|---|---|
| Size | 164.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c978ad5109704b64e8136ebf8f2eb5a6fa123e596468b1d71f8b0f15cb2ecdbf
|
|
BLAKE2b-256 checksum How to use checksums |
7a37d279fb83e70983aabfa9ad9bf8a339f512081320f3bded86a5c61861b598
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|
Release files / yolov5facedetector-1.0.2-py3-none-any.whl
| Download URL | yolov5facedetector-1.0.2-py3-none-any.whl |
|---|---|
| Size | 102.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1acb5120d89369635826b120c68282b2529ef95a1cca75fb1397e68b8f40866f
|
|
BLAKE2b-256 checksum How to use checksums |
02209ffb4c10f41aa285da7458f23e465c6878252b7274e4112501e630f71872
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|