Browse Source
Fix run.py
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
2 additions and
1 deletions
-
benchmark/run.py
|
@ -1,5 +1,6 @@ |
|
|
import os |
|
|
import os |
|
|
import torch |
|
|
import torch |
|
|
|
|
|
import numpy |
|
|
import onnxruntime |
|
|
import onnxruntime |
|
|
|
|
|
|
|
|
import towhee |
|
|
import towhee |
|
@ -48,7 +49,7 @@ query_data = query_data[:query_size] if query_size else query_data |
|
|
# Warm up |
|
|
# Warm up |
|
|
print('Warming up...') |
|
|
print('Warming up...') |
|
|
op = ops.image_embedding.timm(model_name=model_name, device=device).get_op() |
|
|
op = ops.image_embedding.timm(model_name=model_name, device=device).get_op() |
|
|
dummy_input = torch.rand((1,) + op.config['input_size']) |
|
|
|
|
|
|
|
|
dummy_input = numpy.random.randn((1,) + op.config['input_size']) |
|
|
dim = op(dummy_input).shape[0] |
|
|
dim = op(dummy_input).shape[0] |
|
|
print(f'output dim: {dim}') |
|
|
print(f'output dim: {dim}') |
|
|
|
|
|
|
|
|