From 599c80fa9fc5a7703f646edc181dd578f2e0a3eb Mon Sep 17 00:00:00 2001 From: duoduo Date: Sun, 3 Jul 2022 22:21:36 +0800 Subject: [PATCH] update --- example/onnx-runtime/runtime.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example/onnx-runtime/runtime.py b/example/onnx-runtime/runtime.py index 6e38afd..12979d0 100755 --- a/example/onnx-runtime/runtime.py +++ b/example/onnx-runtime/runtime.py @@ -1,4 +1,5 @@ import cv2 +import time import numpy as np import onnxruntime @@ -119,14 +120,19 @@ if __name__ == '__main__': # 加载模型 session = onnxruntime.InferenceSession('FastestDet.onnx') # 目标检测 + start = time.perf_counter() bboxes = detection(session, img, input_width, input_height, 0.8) + end = time.perf_counter() + time = (end - start) * 1000. + print("forward time:%fms"%time) # 加载label names names = [] with open("coco.names", 'r') as f: for line in f.readlines(): names.append(line.strip()) - + + print("=================box info===================") for b in bboxes: print(b) obj_score, cls_index = b[4], int(b[5])