From 47f30528d818bea5ef3676beffd31fc9ee6a538d Mon Sep 17 00:00:00 2001 From: Logan Garrett Date: Mon, 17 Mar 2025 22:28:52 -0400 Subject: [PATCH] adjust for default path config --- frigate/api/app.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frigate/api/app.py b/frigate/api/app.py index 9d7b3768f..2e9725afb 100644 --- a/frigate/api/app.py +++ b/frigate/api/app.py @@ -177,16 +177,20 @@ def config(request: Request): # Add model plus data if plus is enabled if config["plus"]["enabled"]: - model_json_path = FilePath(config["model"]["path"]).with_suffix(".json") - try: - with open(model_json_path, "r") as f: - model_plus_data = json.load(f) - config["model"]["plus"] = model_plus_data - except FileNotFoundError: - config["model"]["plus"] = None - except json.JSONDecodeError: + if "path" in config["model"]: + model_json_path = FilePath(config["model"]["path"]).with_suffix(".json") + try: + with open(model_json_path, "r") as f: + model_plus_data = json.load(f) + config["model"]["plus"] = model_plus_data + except FileNotFoundError: + config["model"]["plus"] = None + except json.JSONDecodeError: + config["model"]["plus"] = None + else: config["model"]["plus"] = None + # use merged labelamp for detector_config in config["detectors"].values(): detector_config["model"]["labelmap"] = (