From 2ea1d34f4fe1196575bd777027c082dc80d1b48d Mon Sep 17 00:00:00 2001 From: ubawurinna Date: Mon, 8 Jul 2024 15:13:33 +0200 Subject: [PATCH] OpenVino - Error clarification for compile_model function (#12304) * Error clarification for openvino's compile_model function * run ruff format --------- Co-authored-by: ubawurinna --- frigate/detectors/plugins/openvino.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/detectors/plugins/openvino.py b/frigate/detectors/plugins/openvino.py index 4ac610d77..a6b0a51cd 100644 --- a/frigate/detectors/plugins/openvino.py +++ b/frigate/detectors/plugins/openvino.py @@ -1,4 +1,5 @@ import logging +import os import numpy as np import openvino as ov @@ -35,6 +36,10 @@ class OvDetector(DetectionApi): ) detector_config.device = "GPU" + if not os.path.isfile(detector_config.model.path): + logger.error(f"OpenVino model file {detector_config.model.path} not found.") + raise FileNotFoundError + self.interpreter = self.ov_core.compile_model( model=detector_config.model.path, device_name=detector_config.device )