logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

19 lines
516 B

3 years ago
import os
import unittest
from towhee import pipeline
from PIL import Image
class TestImageEmbeddingResnet50(unittest.TestCase):
def test_image_embedding_resnet50(self):
3 years ago
img_src = './test_data/test.jpg'
test_img = Image.open(img_src)
dimension = 1000
embedding_pipeline = pipeline('towhee/image-embedding-resnet50')
3 years ago
embedding = embedding_pipeline(test_img)
self.assertEqual((1, dimension), embedding[0][0].shape)
if __name__ == '__main__':
unittest.main()