logo
Browse Source

Update the test script

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 3 years ago
parent
commit
3a85c5d920
  1. 3
      config.py
  2. 15
      test_image_embedding_pipeline_yaml.py

3
config.py

@ -1,3 +0,0 @@
TEST_IMG = './test_data/test.jpg'
DIMENSION = 1000
REPO_NAME = 'towhee/image-embedding-resnet'

15
test_image_embedding_pipeline_yaml.py

@ -3,14 +3,7 @@ from towhee import pipeline
from config import DIMENSION, REPO_NAME, TEST_IMG
class TestImageEmbeddingPipelineClass(unittest.TestCase):
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(TEST_IMG)
assert (1, self.dimension)==op(img_tensor)[0].shape
if __name__ == '__main__':
unittest.main()
def test_image_embedding_resnet50(repo_name='towhee/image-embedding-pipeline-template', img_path='./test_data/test.jpg', dimension=2048):
embedding_pipeline = pipeline(repo_name)
embedding = embedding_pipeline(img_path)
assert (1, dimension)==embedding[0].shape

Loading…
Cancel
Save