From 7012383a55a3723a81a013d760ead2fd56338085 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Wed, 14 Dec 2022 19:25:11 +0800 Subject: [PATCH] Fix image mode issue Signed-off-by: Jael Gu --- benchmark/run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/run.py b/benchmark/run.py index 49cf48f..f3c71de 100644 --- a/benchmark/run.py +++ b/benchmark/run.py @@ -49,8 +49,9 @@ query_data = query_data[:query_size] if query_size else query_data # Warm up print('Warming up...') op = ops.image_embedding.timm(model_name=model_name, device=device).get_op() -dummy_input = numpy.random.randn(op.config['input_size'][0]) -dim = op(dummy_input).shape[0] +dim = towhee.glob('https://raw.githubusercontent.com/towhee-io/towhee/main/towhee_logo.png') \ + .image_decode() \ + .image_embedding.timm(model_name=model_name, device=device)[0].shape[0] print(f'output dim: {dim}') # Prepare Milvus