Add ability to restrict genai to objects and zones at the camera level (#13958)

* Add ability to restrict genai to labels and zones at the camera level

* fix comment

* clarify docs

* use objects instead of labels

* docs

* object list
This commit is contained in:
Josh Hawkins
2024-09-25 10:42:39 -05:00
committed by GitHub
parent e935db5075
commit 4c12673fbb
5 changed files with 38 additions and 1 deletions

View File

@@ -127,6 +127,14 @@ class EmbeddingMaintainer(threading.Thread):
camera_config.genai.enabled
and self.genai_client is not None
and event.data.get("description") is None
and (
camera_config.genai.objects is None
or event.label in camera_config.genai.objects
)
and (
camera_config.genai.required_zones is None
or set(event.zones) & set(camera_config.genai.required_zones)
)
):
# Generate the description. Call happens in a thread since it is network bound.
threading.Thread(