mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-08 13:51:01 +02:00
Fix key error when model path key doesn't exist. (#17217)
* fixed metrics race condition * ruff formatting * adjust for default path config * ruff * check for model too
This commit is contained in:
parent
bf22d89f67
commit
cf16eda76e
@ -177,7 +177,9 @@ def config(request: Request):
|
|||||||
|
|
||||||
# Add model plus data if plus is enabled
|
# Add model plus data if plus is enabled
|
||||||
if config["plus"]["enabled"]:
|
if config["plus"]["enabled"]:
|
||||||
model_json_path = FilePath(config["model"]["path"]).with_suffix(".json")
|
model_path = config.get("model", {}).get("path")
|
||||||
|
if model_path:
|
||||||
|
model_json_path = FilePath(model_path).with_suffix(".json")
|
||||||
try:
|
try:
|
||||||
with open(model_json_path, "r") as f:
|
with open(model_json_path, "r") as f:
|
||||||
model_plus_data = json.load(f)
|
model_plus_data = json.load(f)
|
||||||
@ -186,6 +188,8 @@ def config(request: Request):
|
|||||||
config["model"]["plus"] = None
|
config["model"]["plus"] = None
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
config["model"]["plus"] = None
|
config["model"]["plus"] = None
|
||||||
|
else:
|
||||||
|
config["model"]["plus"] = None
|
||||||
|
|
||||||
# use merged labelamp
|
# use merged labelamp
|
||||||
for detector_config in config["detectors"].values():
|
for detector_config in config["detectors"].values():
|
||||||
|
Loading…
Reference in New Issue
Block a user