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 (Pytorch)

Authors: David Wang

Desription

This opertator detects faces in the images by using RetinaFace Detector[1]. It will returns the bounding box positions and the confidence scores of detected faces. This repo is a adopataion from [2].

from towhee import ops

model = ops.face_detection.retinaface()
embedding = model(img)

Factory Constructor

Create the operator via the following factory method

ops.face_detection.retinaface()

Interface

A face detection operator takes an image as input. it generates the bounding box position and confidence score back to ndarray.

Args:

framework

​ the framework of the model

​ supported types: str, default is 'pytorch'

Parameters:

image

​ the image to detect faces.

​ supported types: numpy.ndarray

Returns::

numpy.ndarray

​ The detected face bounding boxes.

numpy.ndarray

​ The detected face bounding boxes confident scores.

Code Example

get detected face bounding boxes from './img1.jpg'.

Write the pipeline in simplified style:

import towhee.DataCollection as dc

dc.glob('./img1.jpg')
  .image_decode.cv2()
  .face_detection.retinaface()
  .to_list()

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

import towhee.DataCollection as dc

dc.glob['path']('./img1.jpg')
  .image_decode.cv2['path', 'img']()
  .face_detection.retinaface()
  .to_list()

Reference

[1]. https://arxiv.org/abs/1905.00641
[2]. https://github.com/biubug6/Pytorch_Retinaface

wxywb b59a54e1d4 bugfix. 3 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 3 years ago
file-icon README.md
1.6 KiB
download-icon
bugfix. 3 years ago
file-icon __init__.py
672 B
download-icon
update the operator. 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 retinaface.py
1.6 KiB
download-icon
bugfix. 3 years ago
file-icon retinaface_impl.py
1.4 KiB
download-icon
update the operator. 3 years ago