From f09bce86778c2a2081139d8a5394d965c7b28a30 Mon Sep 17 00:00:00 2001 From: wxywb Date: Thu, 2 Feb 2023 09:17:55 +0000 Subject: [PATCH] update the readme. Signed-off-by: wxywb --- README.md | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index f985438..ec98f27 100644 --- a/README.md +++ b/README.md @@ -15,36 +15,23 @@ The pipeline is used to extract the feature vector of detected faces in images. ## Code Example Load an image from path './test_face.jpg'. - *Write the pipeline in simplified style*: - -```python -import towhee -towhee.glob('./test_face.jpg') \ - .image_decode.cv2() \ - .face_embedding.deepface(model_name = 'DeepFace').to_list() -``` - - - - *Write a pipeline with explicit inputs/outputs name specifications:* +from towhee.dc2 import pipe, ops, DataCollection +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', 'vec', ops.face_embedding.deepface(model_name = 'DeepFace'))) + .output('img', 'vec') +) -```python -import towhee +DataCollection(p('./test_face.jpg')).show() -towhee.glob['path']('./test_face.jpg') \ - .image_decode.cv2['path', 'img']() \ - .face_embedding.deepface['img', 'vec'](model_name = 'DeepFace') \ - .select['img','vec']() \ - .show() -``` +
- - ## Factory Constructor Create the operator via the following factory method