From 52f9509d1a343ae9cd82ed8a6dd54a2752d097a0 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Fri, 1 Apr 2022 18:54:52 +0800 Subject: [PATCH] Update README Signed-off-by: Jael Gu --- README.md | 31 +++++++++++++++---------------- result1.png | Bin 0 -> 4050 bytes 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 result1.png 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 0000000000000000000000000000000000000000..b5a03c7e8091eae1f71a6da969ae3854e70714ca GIT binary patch literal 4050 zcmYLMcQ_mD*G{BpqgHLLRjY!cHbKOUz4xfvt7@+xW~+8u)M$vBwQ9v4Evj}zThy+q zC~DWL`sw?=-}U`-u5+H}`QzNrbDj^i{838bFGP zEffHt&OxXun}h&23CchK4d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