|
本帖最后由 mike841211 于 2023-3-17 21:08 编辑
测试环境:
rk3588 ubuntu20.04
rk3399ProD Debian
模型: yolox=>rknn
rk3588 ,200个循环,推理平均速度要200ms左右
rk3399ProD 推理速度:200个循环,平均80ms左右,不科学呀?请问这是啥问题?
代码如下:rknn_model = RK3388_RKNN_MODEL
rknn_lite = RKNNLite()
# load RKNN model
print('--> Load RKNN model')
ret = rknn_lite.load_rknn(rknn_model)
- ori_img = cv2.imread('./street.jpg')
- img = cv2.cvtColor(ori_img, cv2.COLOR_BGR2RGB)
- #ret = rknn_lite.init_runtime()
- #ret = rknn_lite.init_runtime(core_mask=RKNNLite.NPU_CORE_0)
- ret = rknn_lite.init_runtime(core_mask=RKNNLite.NPU_CORE_AUTO)
- img, scale_factor, correction = letterbox(img)
- # Inference
- print('--> Running model')
- for i in range(200):
- start = time.perf_counter()
- outputs = rknn_lite.inference(inputs=[img])
- #outputs = rknn_lite.inference(inputs=[img], data_format="nchw")[0]
- end = time.perf_counter()
- print('运行时间为:{}秒'.format(end - start))
-
- print('done')
- rknn_lite.release()
|
|