forked from Github/frigate
use relative coordinates for masks & zones (#10912)
* Handle zones and masks as relative coords * Ensure that zone coords are saved as relative * Get motion mask working with relative coordinates * Rewrite object mask to use relative coordinates as well * Formatting * Fix always trying to convert * fix mask logic
This commit is contained in:
@@ -137,7 +137,10 @@ def stats_history():
|
||||
|
||||
@bp.route("/config")
|
||||
def config():
|
||||
config = current_app.frigate_config.model_dump(mode="json", exclude_none=True)
|
||||
config_obj: FrigateConfig = current_app.frigate_config
|
||||
config: dict[str, dict[str, any]] = config_obj.model_dump(
|
||||
mode="json", exclude_none=True
|
||||
)
|
||||
|
||||
# remove the mqtt password
|
||||
config["mqtt"].pop("password", None)
|
||||
@@ -154,9 +157,13 @@ def config():
|
||||
for cmd in camera_dict["ffmpeg_cmds"]:
|
||||
cmd["cmd"] = clean_camera_user_pass(" ".join(cmd["cmd"]))
|
||||
|
||||
# ensure that zones are relative
|
||||
for zone_name, zone in config_obj.cameras[camera_name].zones.items():
|
||||
camera_dict["zones"][zone_name]["color"] = zone.color
|
||||
|
||||
config["plus"] = {"enabled": current_app.plus_api.is_active()}
|
||||
|
||||
for detector, detector_config in config["detectors"].items():
|
||||
for detector_config in config["detectors"].values():
|
||||
detector_config["model"]["labelmap"] = (
|
||||
current_app.frigate_config.model.merged_labelmap
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user