diff --git a/frigate/config/config.py b/frigate/config/config.py index 4b6eb68aa..0284e5d35 100644 --- a/frigate/config/config.py +++ b/frigate/config/config.py @@ -511,9 +511,10 @@ class FrigateConfig(FrigateBaseModel): elif detector_config.type == "edgetpu": model_config["path"] = "/edgetpu_model.tflite" - # Verify that the model path points to an existing file. - if not os.path.exists(model_config["path"]): - raise ValueError(f"Model path '{model_config['path']}' does not exist.") + # If using a local file, verify that the model path points to an existing file. + if not model_config["path"].startswith("plus://"): + if not os.path.exists(model_config["path"]): + raise ValueError(f"Model path '{model_config['path']}' does not exist.") model = ModelConfig.model_validate(model_config) model.check_and_load_plus_model(self.plus_api, detector_config.type) diff --git a/frigate/detectors/detector_config.py b/frigate/detectors/detector_config.py index 103b973c2..369aefb05 100644 --- a/frigate/detectors/detector_config.py +++ b/frigate/detectors/detector_config.py @@ -103,14 +103,17 @@ class ModelConfig(BaseModel): def __init__(self, **config): super().__init__(**config) - # Verify that the labelmap path points to an existing file. - if not os.path.exists(config.get("labelmap_path", "/labelmap.txt")): - raise ValueError( - f"Model labelmap_path '{config.get('labelmap_path', '/labelmap.txt')}' does not exist." - ) + path = config.get("labelmap_path", "/labelmap.txt") + + # If using a local file, verify that the labelmap path points to an existing file. + if not path.startswith("plus://"): + if not os.path.exists(path): + raise ValueError( + f"Model labelmap_path '{path}' does not exist." + ) self._merged_labelmap = { - **load_labels(config.get("labelmap_path", "/labelmap.txt")), + **load_labels(path), **config.get("labelmap", {}), } self._colormap = {}