Reuse constants (#16874)

This commit is contained in:
Martin Weinelt
2025-02-28 21:35:09 -07:00
committed by GitHub
parent 06d6e21de8
commit 458134de5d
16 changed files with 55 additions and 30 deletions
+3 -1
View File
@@ -1,10 +1,12 @@
"""Convenience runner for onnx models."""
import logging
import os.path
from typing import Any
import onnxruntime as ort
from frigate.const import MODEL_CACHE_DIR
from frigate.util.model import get_ort_providers
try:
@@ -32,7 +34,7 @@ class ONNXModelRunner:
self.type = "ov"
self.ov = ov.Core()
self.ov.set_property(
{ov.properties.cache_dir: "/config/model_cache/openvino"}
{ov.properties.cache_dir: os.path.join(MODEL_CACHE_DIR, "openvino")}
)
self.interpreter = self.ov.compile_model(
model=model_path, device_name=device