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 b5a03c7..0000000 Binary files a/result1.png and /dev/null differ