logo
clip
repo-copy-icon

copied

Browse Source

update the readme.

Signed-off-by: wxywb <xy.wang@zilliz.com>
main
wxywb 2 years ago
parent
commit
7ac8bd00ce
  1. 10
      README.md
  2. BIN
      tabular1.png
  3. BIN
      vec1.png
  4. BIN
      vec2.png

10
README.md

@ -17,7 +17,7 @@ This operator extracts features for image or text with [CLIP](https://arxiv.org/
## Code Example
Load an image from path './dog.jpg' to generate an image embedding.
Load an image from path './teddy.jpg' to generate an image embedding.
Read the text 'a dog' to generate an text embedding.
*Write the pipeline in simplified style*:
@ -34,7 +34,8 @@ towhee.dc(["a dog"]) \
.towhee.clip(name='ViT-B/32', modality='text') \
.show()
```
<img src="https://towhee.io/image-embedding/dolg/raw/branch/main/result1.png" alt="result1" style="height:20px;"/>
<img src="https://towhee.io/towhee/clip/raw/branch/main/vec1.png" alt="result1" style="height:20px;"/>
<img src="https://towhee.io/towhee/clip/raw/branch/main/vec2.png" alt="result2" style="height:20px;"/>
*Write a same pipeline with explicit inputs/outputs name specifications:*
@ -53,7 +54,7 @@ towhee.dc(["a dog"]) \
.select['data', 'vec']() \
.show()
```
<img src="https://towhee.io/image-embedding/dolg/raw/branch/main/result2.png" alt="result2" style="height:60px;"/>
<img src="https://towhee.io/towhee/clip/raw/branch/main/tabular1.png" alt="result1" style="height:60px;"/>
<br />
@ -82,8 +83,7 @@ Create the operator via the following factory method
## Interface
An image embedding operator takes a [towhee image](link/to/towhee/image/api/doc) as input.
It uses the pre-trained model specified by model name to generate an image embedding in ndarray.
An image-text embedding operator takes a [towhee image](link/to/towhee/image/api/doc) or string as input and generate an image embedding in ndarray.
**Parameters:**

BIN
tabular1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

BIN
vec1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
vec2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save