Browse Source
Update
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
3 changed files with
9 additions and
11 deletions
-
README.md
-
image_embedding_resnet50.yaml
-
BIN
readme_res/pipeline.png
|
@ -10,9 +10,9 @@ The pipeline is used to **extract the feature vector of a given image**. It firs |
|
|
|
|
|
|
|
|
**Input Arguments:** |
|
|
**Input Arguments:** |
|
|
|
|
|
|
|
|
- image: |
|
|
|
|
|
|
|
|
- img_path: |
|
|
- the input image to be encoded |
|
|
- the input image to be encoded |
|
|
- supported types: `PIL.Image` |
|
|
|
|
|
|
|
|
- supported types: `str` (path of the image) |
|
|
|
|
|
|
|
|
**Pipeline Output:** |
|
|
**Pipeline Output:** |
|
|
|
|
|
|
|
@ -36,11 +36,9 @@ $ pip3 install towhee |
|
|
|
|
|
|
|
|
```python |
|
|
```python |
|
|
>>> from towhee import pipeline |
|
|
>>> from towhee import pipeline |
|
|
>>> from PIL import Image |
|
|
|
|
|
|
|
|
|
|
|
>>> img = Image.open('path/to/your/image') |
|
|
|
|
|
>>> embedding_pipeline = pipeline('towhee/image-embedding-resnet50') |
|
|
>>> embedding_pipeline = pipeline('towhee/image-embedding-resnet50') |
|
|
>>> embedding = embedding_pipeline(img) |
|
|
|
|
|
|
|
|
>>> embedding = embedding_pipeline('path/to/your/image') |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## How it works |
|
|
## How it works |
|
|
|
@ -7,7 +7,7 @@ operators: |
|
|
inputs: |
|
|
inputs: |
|
|
- |
|
|
- |
|
|
df: '_start_df' |
|
|
df: '_start_df' |
|
|
name: 'img' |
|
|
|
|
|
|
|
|
name: 'img_path' |
|
|
col: 0 |
|
|
col: 0 |
|
|
outputs: |
|
|
outputs: |
|
|
- |
|
|
- |
|
@ -23,7 +23,7 @@ operators: |
|
|
inputs: |
|
|
inputs: |
|
|
- |
|
|
- |
|
|
df: 'image' |
|
|
df: 'image' |
|
|
name: 'img' |
|
|
|
|
|
|
|
|
name: 'img_path' |
|
|
col: 0 |
|
|
col: 0 |
|
|
outputs: |
|
|
outputs: |
|
|
- |
|
|
- |
|
@ -65,14 +65,14 @@ dataframes: |
|
|
name: '_start_df' |
|
|
name: '_start_df' |
|
|
columns: |
|
|
columns: |
|
|
- |
|
|
- |
|
|
name: 'img' |
|
|
|
|
|
vtype: 'PIL.Image' |
|
|
|
|
|
|
|
|
name: 'img_path' |
|
|
|
|
|
vtype: 'str' |
|
|
- |
|
|
- |
|
|
name: 'image' |
|
|
name: 'image' |
|
|
columns: |
|
|
columns: |
|
|
- |
|
|
- |
|
|
name: 'img' |
|
|
|
|
|
vtype: 'PIL.Image' |
|
|
|
|
|
|
|
|
name: 'img_path' |
|
|
|
|
|
vtype: 'str' |
|
|
- |
|
|
- |
|
|
name: 'image_preproc' |
|
|
name: 'image_preproc' |
|
|
columns: |
|
|
columns: |
|
|
Width:
|
Height:
|
Size: 263 KiB
Width:
|
Height:
|
Size: 264 KiB
|