logo
Browse Source

Update README

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
87379e3c5a
  1. 30
      README.md
  2. 0
      result.png
  3. BIN
      result1.png

30
README.md

@ -18,20 +18,26 @@ who maintains SOTA deep-learning models and tools in computer vision.
Load an image from path './towhee.jpeg' Load an image from path './towhee.jpeg'
and use the pre-trained ResNet50 model ('resnet50') to generate an image embedding. 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 ```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()
``` ```
<img src="./result1.png" height="50px"/>
*Write a same pipeline with explicit inputs/outputs name specifications:*
<img src="./result.png" height="150px"/>
- **option 2:**
```python ```python
import towhee import towhee
@ -41,7 +47,6 @@ towhee.glob['path']('./towhee.jpeg') \
.select['img', 'vec']() \ .select['img', 'vec']() \
.show() .show()
``` ```
<img src="./result2.png" height="150px"/>
<br /> <br />
@ -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. ​ 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')
```
<br /> <br />
***supported_model_names(format=None)*** ***supported_model_names(format=None)***

0
result2.png → result.png

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

BIN
result1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Loading…
Cancel
Save