|
沙发
楼主 |
发表于 2019-2-9 09:36:01
|
只看该作者
统计inference()时间的改动如下:
--- test.py 2019-02-08 17:13:51.681182986 -0800
+++ test.py 2019-02-08 11:44:23.350497563 -0800
@@ -1,6 +1,7 @@
import numpy as np
import cv2
from rknn.api import RKNN
+from datetime import datetime
def show_outputs(outputs):
output = outputs[0][0]
@@ -49,9 +50,11 @@
# Inference
print('--> Running model')
+ start = datetime.now()
outputs = rknn.inference(inputs=[img])
+ end = datetime.now()
show_outputs(outputs)
- print('done')
+ print('inference time:', end - start)
#print('inference result: ', outputs)
rknn.release() |
|