logo
Browse Source

Update

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 3 years ago
parent
commit
d8a59c1ac2
  1. 4
      README.md
  2. 4
      image_embedding_pipeline_template.yaml
  3. 5
      test_image_embedding_pipeline_yaml.py

4
README.md

@ -14,9 +14,9 @@ This pipeline is used to **extract the feature vector of the image**. It first n
**Input Arguments:**
- img_tensor:
- img:
- the input image to be encoded
- supported types: `PIL.Image`
- supported types: `str`
**Pipeline Output:**

4
image_embedding_pipeline_template.yaml

@ -66,13 +66,13 @@ dataframes:
columns:
-
name: 'img'
vtype: 'PIL.Image'
vtype: 'str'
-
name: 'image'
columns:
-
name: 'img'
vtype: 'PIL.Image'
vtype: 'str'
-
name: 'image_preproc'
columns:

5
test_image_embedding_pipeline_yaml.py

@ -1,17 +1,14 @@
import unittest
from towhee import pipeline
from PIL import Image
from config import DIMENSION, REPO_NAME, TEST_IMG
class TestImageEmbeddingPipelineClass(unittest.TestCase):
test_img = Image.open(TEST_IMG)
def test_image_embedding_resnet50(self):
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(self.TEST_IMG)
assert (1, self.dimension)==op(img_tensor)[0].shape

Loading…
Cancel
Save