diff --git a/README.md b/README.md index 74bd956..19da8c2 100644 --- a/README.md +++ b/README.md @@ -20,30 +20,20 @@ This operator detects faces in the images by using [RetinaFace](https://arxiv.or 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:* +*Write a pipeline with explicit inputs/outputs name specifications:* ```python -import towhee +from towhee.dc2 import pipe, ops, DataCollection -towhee.glob('turing.png') \ - .image_decode() \ - .face_detection.retinaface() \ - .show() - -``` -result1 - -*Write a same pipeline with explicit inputs/outputs name specifications:* - -```python -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() +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', ('bbox','score'), ops.face_detection.retinaface()) + .map(('img', 'bbox'),'crop', ops.image_crop()) + .output('img', 'crop', 'bbox', 'score') +) +DataCollection(p('turing.png')).show() ``` result2