mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
apply code formatting
This commit is contained in:
parent
435ca33376
commit
fe52a49f84
@ -32,6 +32,7 @@ yolov8_suffix = {
|
|||||||
"default-yolov8x": "x",
|
"default-yolov8x": "x",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class RknnDetectorConfig(BaseDetectorConfig):
|
class RknnDetectorConfig(BaseDetectorConfig):
|
||||||
type: Literal[DETECTOR_KEY]
|
type: Literal[DETECTOR_KEY]
|
||||||
core_mask: int = Field(default=0, ge=0, le=7, title="Core mask for NPU.")
|
core_mask: int = Field(default=0, ge=0, le=7, title="Core mask for NPU.")
|
||||||
@ -44,7 +45,7 @@ class Rknn(DetectionApi):
|
|||||||
# find out SoC
|
# find out SoC
|
||||||
try:
|
try:
|
||||||
with open("/proc/device-tree/compatible") as file:
|
with open("/proc/device-tree/compatible") as file:
|
||||||
soc = file.read().split(",")[-1].strip('\x00')
|
soc = file.read().split(",")[-1].strip("\x00")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logger.error("Make sure to run docker in privileged mode.")
|
logger.error("Make sure to run docker in privileged mode.")
|
||||||
raise Exception("Make sure to run docker in privileged mode.")
|
raise Exception("Make sure to run docker in privileged mode.")
|
||||||
@ -73,7 +74,9 @@ class Rknn(DetectionApi):
|
|||||||
|
|
||||||
if self.model_path in yolov8_suffix:
|
if self.model_path in yolov8_suffix:
|
||||||
if self.model_path == "default-yolov8n":
|
if self.model_path == "default-yolov8n":
|
||||||
self.model_path = "/models/rknn/yolov8n-320x320-{soc}.rknn".format(soc=soc)
|
self.model_path = "/models/rknn/yolov8n-320x320-{soc}.rknn".format(
|
||||||
|
soc=soc
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
model_suffix = yolov8_suffix[self.model_path]
|
model_suffix = yolov8_suffix[self.model_path]
|
||||||
self.model_path = (
|
self.model_path = (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user