From 331c882af2aa5921a7848a6a3354b2b11b06b7e7 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 22 Jul 2024 12:59:30 -0600 Subject: [PATCH] Catch hailo initialization error (#12558) --- frigate/detectors/plugins/hailo8l.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/frigate/detectors/plugins/hailo8l.py b/frigate/detectors/plugins/hailo8l.py index cb797baeb..a157e240d 100644 --- a/frigate/detectors/plugins/hailo8l.py +++ b/frigate/detectors/plugins/hailo8l.py @@ -3,17 +3,22 @@ import os import urllib.request import numpy as np -from hailo_platform import ( - HEF, - ConfigureParams, - FormatType, - HailoRTException, - HailoStreamInterface, - InferVStreams, - InputVStreamParams, - OutputVStreamParams, - VDevice, -) + +try: + from hailo_platform import ( + HEF, + ConfigureParams, + FormatType, + HailoRTException, + HailoStreamInterface, + InferVStreams, + InputVStreamParams, + OutputVStreamParams, + VDevice, + ) +except ModuleNotFoundError: + pass + from pydantic import BaseModel, Field from typing_extensions import Literal