fix rknn.py (#8434)

Co-authored-by: MarcA711 <>
This commit is contained in:
Marc Altmann 2023-11-03 01:12:54 +01:00 committed by GitHub
parent fc36be4f88
commit b54aaad382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,6 @@ import cv2.dnn
import numpy as np import numpy as np
from hide_warnings import hide_warnings from hide_warnings import hide_warnings
from pydantic import Field from pydantic import Field
from rknnlite.api import RKNNLite
from frigate.detectors.detection_api import DetectionApi from frigate.detectors.detection_api import DetectionApi
from frigate.detectors.detector_config import BaseDetectorConfig from frigate.detectors.detector_config import BaseDetectorConfig
@ -37,6 +36,8 @@ class Rknn(DetectionApi):
self.model_path = config.model.path or "/models/yolov8n-320x320.rknn" self.model_path = config.model.path or "/models/yolov8n-320x320.rknn"
from rknnlite.api import RKNNLite
self.rknn = RKNNLite(verbose=False) self.rknn = RKNNLite(verbose=False)
if self.rknn.load_rknn(self.model_path) != 0: if self.rknn.load_rknn(self.model_path) != 0:
logger.error("Error initializing rknn model.") logger.error("Error initializing rknn model.")