From 880dd47951d3794af9d796b84284e6ae2cdb7240 Mon Sep 17 00:00:00 2001 From: wxywb Date: Thu, 2 Feb 2023 09:03:16 +0000 Subject: [PATCH] update the readme. Signed-off-by: wxywb --- README.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 95cef29..f59f4bf 100644 --- a/README.md +++ b/README.md @@ -19,28 +19,21 @@ This operator extracts embedding vector from facial image using [Inception-ResNe Extract face image embedding from './img.png'. - *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('./img.png') \ - .image_decode.cv2() \ - .face_embedding.inceptionresnetv1() \ - .to_list() -``` - -*Write a same pipeline with explicit inputs/outputs name specifications:* +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', 'vec', ops.face_embedding.inceptionresnetv1()) + .output('img', 'vec') +) -```python -import towhee - -towhee.glob['path']('./img.png') \ - .image_decode.cv2['path', 'img']() \ - .face_embedding.inceptionresnetv1['img', 'vec']() \ - .select['img','vec']() \ - .show() +DataCollection(p('img.png')).show() ``` + result