mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 06:40:22 +00:00
Prompt adjustment
This commit is contained in:
parent
8cf292a9c2
commit
5abef619d0
@ -1,5 +1,6 @@
|
||||
"""Post processor for review items to get descriptions."""
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
@ -95,7 +96,9 @@ class ReviewDescriptionProcessor(PostProcessorApi):
|
||||
"objects": final_data["data"]["objects"],
|
||||
"recognized_objects": final_data["data"]["sub_labels"],
|
||||
"zones": final_data["data"]["zones"],
|
||||
"timestamp": final_data["end_time"],
|
||||
"timestamp": datetime.datetime.fromtimestamp(
|
||||
final_data["end_time"]
|
||||
),
|
||||
},
|
||||
[r[1] for r in self.tracked_review_items[id]],
|
||||
)
|
||||
|
||||
@ -39,7 +39,7 @@ class GenAIClient:
|
||||
) -> None:
|
||||
"""Generate a description for the review item activity."""
|
||||
context_prompt = f"""
|
||||
Please analyze the image(s), which are in chronological order, strictly from the perspective of the {review_data["camera"].replace("_", " ")} security camera.
|
||||
Please analyze the image(s), which are in chronological order, strictly from the perspective of the {review_data['camera'].replace('_', ' ')} security camera.
|
||||
Your task is to provide a **neutral, factual, and objective description** of the scene and the objects interacting with it.
|
||||
Focus solely on observable actions, visible entities, and the environment.
|
||||
|
||||
@ -57,7 +57,7 @@ class GenAIClient:
|
||||
**IMPORTANT:** The value for each field (e.g., "scene", "action") must be a plain string or integer, NOT another JSON object or a description of the field itself.
|
||||
|
||||
Provide the response in the exact JSON format specified by this schema:
|
||||
{ReviewMetadata.model_json_schema()}
|
||||
{ReviewMetadata.model_json_schema()['properties']}
|
||||
"""
|
||||
logger.info(f"processing {review_data}")
|
||||
logger.info(f"Got GenAI review: {self._send(context_prompt, thumbnails)}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user