Which system do you use? Android, Ubuntu, OOWOW or others?
Ubuntu
Which version of system do you use? Khadas official images, self built images, or others?
Yes official 22.04
Please describe your issue below:
Translate NPU example command line in Python script
Post a console log of your issue below:
Dear friends, do you know a way to convert this cli like this :
$ sudo ./yolov8n_cap -m ../data/yolov8n_int8.adla -d 0 -w 320 -h 240
In python script : I tested this
from ultralytics import YOLO
import cv2
cap = cv2.VideoCapture(0)
model = YOLO ('yolov8n_int81.adla',task='detect')
while True:
ret, img= cap.read()
results = model(img, stream=True)
cv2.imshow('Webcam', img)
if cv2.waitKey(1) == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
It seems working but I meet this error message :
fp16 &= pt or jit or onnx or xml or engine or nn_module or triton # FP16
TypeError: unsupported operand type(s) for &=: 'bool' and 'str'
Note : Python 3.9.16 used.
Except this NPU works fine through cli.
Kind regards,