diff --git a/docs/docs/configuration/genai.md b/docs/docs/configuration/genai.md index 9e0df67bd..874f45069 100644 --- a/docs/docs/configuration/genai.md +++ b/docs/docs/configuration/genai.md @@ -128,7 +128,7 @@ genai: car: "Label the primary vehicle in these images with just the name of the company if it is a delivery vehicle, or the color make and model." ``` -Prompts can also be overriden at the camera level to provide a more detailed prompt to the model about your specific camera, if you desire. By default, descriptions will be generated for all tracked labels and all zones. But you can also optionally specify `labels` and `required_zones` to only generate descriptions for certain labels or zones. +Prompts can also be overriden at the camera level to provide a more detailed prompt to the model about your specific camera, if you desire. By default, descriptions will be generated for all tracked objects and all zones. But you can also optionally specify `objects` and `required_zones` to only generate descriptions for certain tracked objects or zones. ```yaml cameras: @@ -138,7 +138,7 @@ cameras: object_prompts: person: "Describe the main person in these images (gender, age, clothing, activity, etc). Do not include where the activity is occurring (sidewalk, concrete, driveway, etc). If delivering a package, include the company the package is from." cat: "Describe the cat in these images (color, size, tail). Indicate whether or not the cat is by the flower pots. If the cat is chasing a mouse, make up a name for the mouse." - labels: + objects: - person - cat required_zones: diff --git a/frigate/config.py b/frigate/config.py index f82c71ad7..a621c478f 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -810,8 +810,8 @@ class GenAICameraConfig(BaseModel): title="Default caption prompt.", ) object_prompts: Dict[str, str] = Field(default={}, title="Object specific prompts.") - labels: Optional[List[str]] = Field( - default=None, title="Labels to run generative AI for." + objects: Dict[str, int] = Field( + default_factory=dict, title="Objects to run generative AI for." ) required_zones: Union[str, List[str]] = Field( default_factory=list, diff --git a/frigate/embeddings/maintainer.py b/frigate/embeddings/maintainer.py index a18f5518c..0cf85fccf 100644 --- a/frigate/embeddings/maintainer.py +++ b/frigate/embeddings/maintainer.py @@ -128,12 +128,12 @@ class EmbeddingMaintainer(threading.Thread): and self.genai_client is not None and event.data.get("description") is None and ( - camera_config.genai.labels is None - or event.label in camera_config.genai.labels + 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.zones) + or set(event.zones) & set(camera_config.genai.required_zones) ) ): # Generate the description. Call happens in a thread since it is network bound. diff --git a/web/src/types/frigateConfig.ts b/web/src/types/frigateConfig.ts index 2ab865c5a..68003f0e0 100644 --- a/web/src/types/frigateConfig.ts +++ b/web/src/types/frigateConfig.ts @@ -307,7 +307,7 @@ export interface FrigateConfig { prompt: string; object_prompts: { [key: string]: string }; required_zones: string[]; - labels: string[]; + objects: string[]; }; go2rtc: {