support for rknn.rknnpool.is_available

This commit is contained in:
yoni13
2025-01-11 10:39:45 +08:00
parent a2722e16e7
commit c20d110257
2 changed files with 17 additions and 1 deletions
+14
View File
@@ -5,6 +5,20 @@ from queue import Queue
from rknnlite.api import RKNNLite
from concurrent.futures import ThreadPoolExecutor, as_completed
supported_socs = ["rk3566","rk3568","rk3588"]
with open('/proc/device-tree/compatible') as f:
# Keep in mind that this is not in container by default.
# and this way of checking can't check if the rknpu driver is running or not.
device_compatible_str = f.read()
for soc in supported_socs:
if soc in device_compatible_str:
is_available = True
break
else:
is_available = False
def initRKNN(rknnModel="./rknnModel/yolov5s.rknn", id=0):
rknn_lite = RKNNLite()