-
Notifications
You must be signed in to change notification settings - Fork 662
Closed
Description
.rknn model is transform from rknn2 and it can run correctly in rktoolkit2 in PC.
However, it got wrong when using 'runtime' to infer and got all zero result, while the shape of result is correct. The input has already checked.(there is no example in runtime usage, while my model is not used as any way in 'vision' example).

The code is below:
import fastdeploy as fd
from fastdeploy import ModelFormat
import numpy as np
import cv2
camera = cv2.VideoCapture(2)
option = fd.RuntimeOption()
option.set_model_path("mymodel.rknn", model_format=ModelFormat.RKNN)
option.use_cpu()
option.use_rknpu2(rknpu2_name=fd.c_lib_wrap.CpuName.RK3588,rknpu2_core=fd.c_lib_wrap.CoreMask.RKNN_NPU_CORE_AUTO)
runtime = fd.Runtime(option)
input_name = runtime.get_input_info(0).name
while True:
ret,frame = camera.read()
cv2.imshow("test",frame)
cv2.waitKey(1)
rgb_array = cv2.resize(frame,(320,176))
hsv_array = cv2.cvtColor(rgb_array,cv2.COLOR_BGR2HSV).reshape((1,176,320,3))
# print(hsv_array)
results = runtime.infer({
input_name: hsv_array
})
input_check = hsv_array
output_check = runtime.num_outputs()
print(input_check)
print(output_check)
print(results)Metadata
Metadata
Assignees
Labels
No labels