mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 13:07:44 +03:00
add plus data to config api response
This commit is contained in:
parent
03da70cb81
commit
0e515ac6da
@ -9,6 +9,7 @@ import traceback
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
from pathlib import Path as FilePath
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
import aiofiles
|
import aiofiles
|
||||||
@ -174,6 +175,18 @@ def config(request: Request):
|
|||||||
config["model"]["all_attributes"] = config_obj.model.all_attributes
|
config["model"]["all_attributes"] = config_obj.model.all_attributes
|
||||||
config["model"]["non_logo_attributes"] = config_obj.model.non_logo_attributes
|
config["model"]["non_logo_attributes"] = config_obj.model.non_logo_attributes
|
||||||
|
|
||||||
|
# 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:
|
||||||
|
config["model"]["plus"] = None
|
||||||
|
|
||||||
# use merged labelamp
|
# use merged labelamp
|
||||||
for detector_config in config["detectors"].values():
|
for detector_config in config["detectors"].values():
|
||||||
detector_config["model"]["labelmap"] = (
|
detector_config["model"]["labelmap"] = (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user