mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
Handling Import and file not found Error for non-arm devices.
This commit is contained in:
parent
66004e3b83
commit
d10147f478
@ -2,22 +2,24 @@
|
||||
# Following Apache License 2.0
|
||||
|
||||
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
|
||||
|
||||
try:
|
||||
from rknn.api import RKNNLite
|
||||
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
|
||||
except (FileNotFoundError, ImportError):
|
||||
is_available = False
|
||||
|
||||
|
||||
def initRKNN(rknnModel="./rknnModel/yolov5s.rknn", id=0):
|
||||
|
Loading…
x
Reference in New Issue
Block a user