From d8a59c1ac268c40d95ff907155f573e6dfc6dcd1 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Thu, 16 Dec 2021 16:27:36 +0800 Subject: [PATCH] Update Signed-off-by: shiyu22 --- README.md | 4 ++-- image_embedding_pipeline_template.yaml | 4 ++-- test_image_embedding_pipeline_yaml.py | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cbb11f9..c04288f 100644 --- a/README.md +++ b/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:** diff --git a/image_embedding_pipeline_template.yaml b/image_embedding_pipeline_template.yaml index 75996fb..d1dfbe6 100644 --- a/image_embedding_pipeline_template.yaml +++ b/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: diff --git a/test_image_embedding_pipeline_yaml.py b/test_image_embedding_pipeline_yaml.py index 0e74d49..92c1f7f 100644 --- a/test_image_embedding_pipeline_yaml.py +++ b/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