logo
Browse Source

Update

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 3 years ago
parent
commit
911ef5feea
  1. 8
      README.md
  2. 8
      image_embedding_pipeline_template.yaml
  3. BIN
      readme_res/pipeline.png
  4. 2
      test_image_embedding_pipeline_yaml.py

8
README.md

@ -14,9 +14,9 @@ This pipeline is used to **extract the feature vector of the image**. It first n
**Input Arguments:**
- img:
- img_path:
- the input image to be encoded
- supported types: `str`
- supported types: `str` (path of the image)
**Pipeline Output:**
@ -40,11 +40,9 @@ $ pip3 install towhee
```Python
>>> from towhee import pipeline
>>> from PIL import Image
>>> img = Image.open('path/to/your/image') #for example './test.jpg'
>>> embedding_pipeline = pipeline('user/repo_name') #the pipeline repo, such as 'towhee/image-embedding-resnet50'
>>> embedding = embedding_pipeline(img)
>>> embedding = embedding_pipeline('path/to/your/image')
```
## **How it works**

8
image_embedding_pipeline_template.yaml

@ -7,7 +7,7 @@ operators:
inputs:
-
df: '_start_df'
name: 'img'
name: 'img_path'
col: 0
outputs:
-
@ -23,7 +23,7 @@ operators:
inputs:
-
df: 'image'
name: 'img'
name: 'img_path'
col: 0
outputs:
-
@ -65,13 +65,13 @@ dataframes:
name: '_start_df'
columns:
-
name: 'img'
name: 'img_path'
vtype: 'str'
-
name: 'image'
columns:
-
name: 'img'
name: 'img_path'
vtype: 'str'
-
name: 'image_preproc'

BIN
readme_res/pipeline.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 264 KiB

2
test_image_embedding_pipeline_yaml.py

@ -8,7 +8,7 @@ class TestImageEmbeddingPipelineClass(unittest.TestCase):
self.dimension = DIMENSION #the dimension of image embedding
self.repo_name = REPO_NAME
embedding_pipeline = pipeline(self.repo_name)
embedding = embedding_pipeline(self.TEST_IMG)
embedding = embedding_pipeline(TEST_IMG)
assert (1, self.dimension)==op(img_tensor)[0].shape

Loading…
Cancel
Save