Dynamic attributes config (#14035)

* Add config for attribute map and generate all labels from the map

* Update docs

* Formatting

* Use the dynamic label map

* Fix check

* Fix docs typo
This commit is contained in:
Nicolas Mowen
2024-09-28 07:49:04 -06:00
committed by GitHub
parent 7da44115d3
commit 38d398c967
7 changed files with 57 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ from frigate.config import (
SnapshotsConfig,
ZoomingModeEnum,
)
from frigate.const import ALL_ATTRIBUTE_LABELS, CLIPS_DIR, UPDATE_CAMERA_ACTIVITY
from frigate.const import CLIPS_DIR, UPDATE_CAMERA_ACTIVITY
from frigate.events.types import EventStateEnum, EventTypeEnum
from frigate.ptz.autotrack import PtzAutoTrackerThread
from frigate.util.image import (
@@ -752,7 +752,10 @@ class CameraState:
sub_label = None
if obj.obj_data.get("sub_label"):
if obj.obj_data.get("sub_label")[0] in ALL_ATTRIBUTE_LABELS:
if (
obj.obj_data.get("sub_label")[0]
in self.config.model.all_attributes
):
label = obj.obj_data["sub_label"][0]
else:
label = f"{object_type}-verified"