diff --git a/README.md b/README.md index 8b1b183..f914683 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,16 @@ and use the pretrained SWAG model 'vit_b16_in1k' to generate an image embedding. *Write a pipeline with explicit inputs/outputs name specifications:* ```python -import towhee - -( - towhee.glob['path']('./towhee.jpg') - .image_decode['path', 'img']() - .image_embedding.swag['img', 'vec'](model_name='vit_b16_in1k') - .select['img', 'vec']() - .show() +from towhee.dc2 import pipe, ops, DataCollection + +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', 'vec', ops.image_embedding.swag(model_name='vit_b16_in1k')) + .output('img', 'vec') ) + +DataCollection(p('towhee.jpeg')).show() ```