From 88c112f50e4f076c72474a3622f189b26890aab7 Mon Sep 17 00:00:00 2001 From: junjiejiangjjj Date: Tue, 31 Jan 2023 18:00:03 +0800 Subject: [PATCH] update readme Signed-off-by: junjiejiangjjj --- README.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dd6b664..a249c1a 100644 --- a/README.md +++ b/README.md @@ -25,26 +25,18 @@ Load a image from path './dog.jpg'. *Write the pipeline in simplified style:* ```python -import towhee +from towhee.dc2 import pipe, ops, DataCollection -towhee.glob('./dog.jpg') \ - .image_decode.cv2() \ - .show() -``` - -*Write a same pipeline with explicit inputs/outputs name specifications:* -```python -import towhee +p = ( + pipe.input('url') + .map('url', 'image', ops.image_decode.cv2()) + .output('image') +) -towhee.glob['path']('./dog.jpg') \ - .image_decode.cv2['path', 'img']() \ - .select['img']() \ - .show() +DataCollection(p('./dog.jpg')).show() ``` - - @@ -75,7 +67,7 @@ An image decode operator takes an image path as input. It decodes the image back **img**: *str* -​ Image file path. +​ Local file path or http url.