logo
Browse Source

add result images.

Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb 3 years ago
parent
commit
1b22aa6a91
  1. 27
      README.md
  2. 4
      __init__.py
  3. BIN
      result1.png
  4. BIN
      result2.png

27
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()
```
<img src="https://towhee.io/face-detection/retinaface/raw/branch/main/result1.png" alt="result1" style="height:20px;"/>
*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()
```
<img src="https://towhee.io/face-detection/retinaface/raw/branch/main/result2.png" alt="result2" style="height:60px;"/>
## 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

4
__init__.py

@ -14,6 +14,6 @@
from .retinaface import Retinaface
def retinaface(framework: str = 'pytorch'):
return Retinaface(framework)
def retinaface():
return Retinaface()

BIN
result1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
result2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Loading…
Cancel
Save