copied
Readme
Files and versions
Updated 3 years ago
face-detection
RetinaFace Face Detection
author: David Wang
Description
This operator detects faces in the images by using RetinaFace Detector. It will return the bounding box positions and the confidence scores of detected faces. This repository is an adaptation from biubug6/Pytorch_Retinaface.
Code Example
Load an image from path './turing.png' and use the pre-trained RetinaFace model to generate face bounding boxes and confidence scores.
Write the pipeline in simplified style:
import towhee
towhee.glob('turing.png') \
.image_decode() \
.face_detection.retinaface() \
.show()
Write a same pipeline with explicit inputs/outputs name specifications:
import towhee
towhee.glob['path']('turing.png') \
.image_decode['path', 'img']() \
.face_detection.retinaface['img', ('bbox','score')]() \
.image_crop[('img', 'bbox'), 'crop']()\
.select('img', 'crop', 'bbox', 'score').show()
Factory Constructor
Create the operator via the following factory method:
face_detection.retinaface()
Interface
A face detection operator takes an image as input. It generates the bounding box positions and confidence scores in ndarray.
Parameters:
img: towhee.types.Image (a sub-class of numpy.ndarray)
the image to detect faces from.
supported types: numpy.ndarray
Returns:
List[(int, int, int, int)]
The position of the bounding boxes for the faces detected.
List[float]
The confidence scores for the face detected in the bounding boxes.
ChengZi
37df7d6223
| 14 Commits | ||
---|---|---|---|
.DS_Store |
6.0 KiB
|
3 years ago | |
.gitattributes |
1.1 KiB
|
3 years ago | |
README.md |
1.9 KiB
|
3 years ago | |
__init__.py |
672 B
|
3 years ago | |
pytorch_retinaface_mobilenet_widerface.pth |
1.7 MiB
|
3 years ago | |
requirements.txt |
69 B
|
3 years ago | |
result1.png |
15 KiB
|
3 years ago | |
result2.jpg |
202 KiB
|
3 years ago | |
retinaface.py |
1.6 KiB
|
3 years ago | |
retinaface_impl.py |
1.4 KiB
|
3 years ago |