diff --git a/README.md b/README.md index c04288f..45333ee 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: +- 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** diff --git a/image_embedding_pipeline_template.yaml b/image_embedding_pipeline_template.yaml index d1dfbe6..4d1e9b3 100644 --- a/image_embedding_pipeline_template.yaml +++ b/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' diff --git a/readme_res/pipeline.png b/readme_res/pipeline.png index bc1a77d..5dbc0d7 100644 Binary files a/readme_res/pipeline.png and b/readme_res/pipeline.png differ diff --git a/test_image_embedding_pipeline_yaml.py b/test_image_embedding_pipeline_yaml.py index 92c1f7f..cac3ed3 100644 --- a/test_image_embedding_pipeline_yaml.py +++ b/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