From f92a8bec749d35fccbb01f8d6523e997684dfcd0 Mon Sep 17 00:00:00 2001 From: wxywb Date: Thu, 2 Feb 2023 12:25:32 +0000 Subject: [PATCH] update the readme. Signed-off-by: wxywb --- README.md | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d85a470..f1927c2 100644 --- a/README.md +++ b/README.md @@ -19,27 +19,19 @@ Extract facial landmarks from './img1.jpg'. -*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('./img1.jpg') \ - .image_decode.cv2() \ - .face_landmark_detection.mobilefacenet() \ - .to_list() -``` - -*Write a same pipeline with explicit inputs/outputs name specifications:* - -```python -import towhee +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', 'landmark', ops.face_landmark_detection.mobilefacenet()) + .output('img', 'landmark') +) -towhee.glob['path']('./img1.jpg') \ - .image_decode.cv2['path', 'img']() \ - .face_landmark_detection.mobilefacenet['img', 'landmark']() \ - .select['img','landmark']() \ - .show() +DataCollection(p('./img1.jpg')).show() ``` result1