From 87379e3c5a8102efa2ddf9317867eb9d609f0c50 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Thu, 29 Dec 2022 16:40:45 +0800 Subject: [PATCH] Update README Signed-off-by: Jael Gu --- README.md | 30 +++++++++++++++++++++--------- result2.png => result.png | Bin result1.png | Bin 4050 -> 0 bytes 3 files changed, 21 insertions(+), 9 deletions(-) rename result2.png => result.png (100%) delete mode 100644 result1.png diff --git a/README.md b/README.md index 028175a..b559dda 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,26 @@ who maintains SOTA deep-learning models and tools in computer vision. Load an image from path './towhee.jpeg' and use the pre-trained ResNet50 model ('resnet50') to generate an image embedding. - *Write the pipeline in simplified style:* +*Write a same pipeline with explicit inputs/outputs name specifications:* + +- **option 1:** ```python -import towhee +from towhee.dc2 import pipe, ops, DataCollection -towhee.glob('./towhee.jpeg') \ - .image_decode() \ - .image_embedding.timm(model_name='resnet50') \ - .show() +p = ( + pipe.input('path') + .map('path', 'img', ops.image_decode()) + .map('img', 'vec', ops.image_embedding.timm(model_name='resnet50')) + .output('img', 'vec') +) + +DataCollection(p('towhee.jpeg')).show() ``` - -*Write a same pipeline with explicit inputs/outputs name specifications:* + +- **option 2:** ```python import towhee @@ -41,7 +47,6 @@ towhee.glob['path']('./towhee.jpeg') \ .select['img', 'vec']() \ .show() ``` -
@@ -104,6 +109,13 @@ Save model to local with specified format. ​ The path where model is saved to. By default, it will save model to the operator directory. +```python +from towhee import ops + +op = ops.image_embedding.timm(model_name='resnet50').get_op() +op.save_model('onnx', 'test.onnx') +``` +
***supported_model_names(format=None)*** diff --git a/result2.png b/result.png similarity index 100% rename from result2.png rename to result.png diff --git a/result1.png b/result1.png deleted file mode 100644 index b5a03c7e8091eae1f71a6da969ae3854e70714ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4050 zcmYLMcQ_mD*G{BpqgHLLRjY!cHbKOUz4xfvt7@+xW~+8u)M$vBwQ9v4Evj}zThy+q zC~DW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