logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

Updated 3 years ago

face-detection

RetinaFace Face Detection

Authors: David Wang

Desription

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 repo is an adaptaion from biubug6/Pytorch_Retinaface.

Code Example

Load an image from path './turing.png' and use the pretrained RetinaFace model to generate face bounding boxes and confidence scores.

Write the pipeline in simplified style:

import towhee

towhee.glob('turing.png') \
  .image_decode.cv2() \
  .face_detection.retinaface() \
  .show()

result1

Write a same pipeline with explicit inputs/outputs name specifications:

import towhee

towhee.glob['path']('turing.png') \
  .image_decode.cv2['path', 'img']() \
  .face_detection.retinaface['img', ('bbox','score')]() \
  .select('img', 'bbox', 'score') \
  .show()
result2

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 back to ndarray.

Parameters:

img: towhee.types.Image (a sub-class of numpy.ndarray)

​ the image to detect faces.

​ supported types: numpy.ndarray

Returns:

List[(int, int, int, int)]

​ The detected face bounding boxes.

List[float]

​ The detected face bounding boxes confident scores.

wxywb 66b3cafe4e update sample image. 8 Commits
file-icon .DS_Store
6.0 KiB
download-icon
remove sample picture. 3 years ago
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 3 years ago
file-icon README.md
1.7 KiB
download-icon
update sample image. 3 years ago
file-icon __init__.py
672 B
download-icon
add result images. 3 years ago
file-icon pytorch_retinaface_mobilenet_widerface.pth
1.7 MiB
download-icon
update the operator. 3 years ago
file-icon requirements.txt
5 B
download-icon
update the operator. 3 years ago
file-icon result1.png
15 KiB
download-icon
update sample image. 3 years ago
file-icon result2.png
123 KiB
download-icon
update sample image. 3 years ago
file-icon retinaface.py
1.6 KiB
download-icon
fix display issue. 3 years ago
file-icon retinaface_impl.py
1.4 KiB
download-icon
update the operator. 3 years ago