|
谢谢,这个刚才有参考修改模型(使用了提供的mobilenet_v1的test case),但是出现了警告,从total time上看好像还是只推理了一张图片,唯一不同的是输入是个彩色图片(3通道),而ex是灰度图片,这并不影响吧?
报出的警告如下:
--> Init runtime environment
done
--> Running model
W RKNNAPI: warning: inputs[0] expected input len is 150528, but actual len is 451584!
----------------------------------------
[array([[0. , 0. , 0. , ..., 0. , 0. ,
0.00028157]], dtype=float32)]
----------------------------------------
done
--> Begin evaluate model performance
W RKNNAPI: warning: inputs[0] expected input len is 150528, but actual len is 451584!
========================================================================
Performance
========================================================================
Total Time(us): 7679
FPS: 130.23
========================================================================
主要将输入进行了修改如下:
# Set inputs
img = cv2.imread('./dog_224x224.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = cv2.resize(img,(224,224),interpolation = cv2.INTER_AREA)
img1 = cv2.imread('./dog.jpg')
img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2RGB)
img1 = cv2.resize(img1,(224,224),interpolation = cv2.INTER_AREA)
img2 = cv2.imread('./dog1.jpg')
img2 = cv2.cvtColor(img2, cv2.COLOR_BGR2RGB)
img2 = cv2.resize(img2,(224,224),interpolation = cv2.INTER_AREA)
img3 = cv2.imread('./dog2.jpg')
img3 = cv2.cvtColor(img3, cv2.COLOR_BGR2RGB)
img3 = cv2.resize(img3,(224,224),interpolation = cv2.INTER_AREA)
image_array=[]
image_array.append(img1)
image_array.append(img2)
image_array.append(img3)
#im = img3.reshape(224,224,3)
#image_array.append(im)
mat = np.array(image_array).reshape(3,224,224,3) |
|