diff --git a/README.md b/README.md index b3edd6f..c0b46d1 100644 --- a/README.md +++ b/README.md @@ -13,35 +13,34 @@ which maintains SOTA deep-learning models and tools in computer vision. ## Code Example -Load an image from path './dog.jpg' +Load an image from path './towhee.jpg' and use the pretrained ResNet50 model ('resnet50') to generate an image embedding. *Write the pipeline in simplified style*: ```python -from towhee import dc +import towhee -dc.glob('./dog.jpg') \ - .image_decode.cv2() \ - .image_embedding.timm(model_name='resnet50') \ - .show() +towhee.glob('./towhee.jpg') \ + .image_decode.cv2() \ + .image_embedding.timm(model_name='resnet50') \ + .show() ``` - | [0.052790146, 0.0, 0.0, ...] shape=(2048,) | +result1 + +![result1](result1.png) *Write a same pipeline with explicit inputs/outputs name specifications:* ```python -from towhee import dc +import towhee -dc.glob['path']('./dog.jpg') \ - .image_decode.cv2['path', 'img']() \ - .image_embedding.timm['img', 'vec'](model_name='resnet50') \ - .select('vec') \ - .to_list() +towhee.glob['path']('./dog.jpg') \ + .image_decode.cv2['path', 'img']() \ + .image_embedding.timm['img', 'vec'](model_name='resnet50') \ + .select('img', 'vec') \ + .show('img', 'vec') ``` - [array([0.05279015, 0. , 0. , ..., 0.00239191, 0.06632169, - 0. ], dtype=float32)] - ## Factory Constructor diff --git a/result1.png b/result1.png new file mode 100644 index 0000000..b5a03c7 Binary files /dev/null and b/result1.png differ