diff --git a/README.md b/README.md index 62fd4d1..5876f78 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Desription -This operator detects faces in the images by using RetinaFace Detector[1]. It will return the bounding box positions and the confidence scores of detected faces. This repo is a adapataion from [2]. +This operator detects faces in the images by using [RetinaFace](https://arxiv.org/abs/1905.00641) Detector. It will return the bounding box positions and the confidence scores of detected faces. This repo is a adapataion from [repo](https://github.com/biubug6/Pytorch_Retinaface). ## Code Example @@ -16,24 +16,29 @@ and use the pretrained RetinaFace to generate face bounding boxes. *Write the pipeline in simplified style*: ```python -from towhee import ops +import towhee -bboxes = dc.glob('nmb46.jpg') \ +towhee.glob('turing.png') \ .image_decode.cv2() \ .face_detection.retinaface() \ - .to_list() + .show() + ``` +result1 + *Write a same pipeline with explicit inputs/outputs name specifications:* ```python -from towhee import dc +import towhee -dc.glob['path']('./dog.jpg') \ +towhee.glob['path']('turing.png') \ .image_decode.cv2['path', 'img']() \ - .image_embedding.timm['img', 'vec'](model_name='resnet50') \ - .face_detection.retinaface() \ - .to_list() + .face_detection.retinaface['img', ('bbox','score')]() \ + .select('img', 'bbox', 'score').show() ``` + +result2 + ## Factory Constructor Create the operator via the following factory method. @@ -62,7 +67,3 @@ A face detection operator takes an image as input. it generates the bounding box ​ The detected face bounding boxes confident scores. -## Reference - -[1]. https://arxiv.org/abs/1905.00641 -[2]. https://github.com/biubug6/Pytorch_Retinaface diff --git a/__init__.py b/__init__.py index feafe9d..98ce600 100644 --- a/__init__.py +++ b/__init__.py @@ -14,6 +14,6 @@ from .retinaface import Retinaface -def retinaface(framework: str = 'pytorch'): - return Retinaface(framework) +def retinaface(): + return Retinaface() diff --git a/result1.png b/result1.png new file mode 100644 index 0000000..f9e17d7 Binary files /dev/null and b/result1.png differ diff --git a/result2.png b/result2.png new file mode 100644 index 0000000..90a6212 Binary files /dev/null and b/result2.png differ