mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-29 18:17:40 +03:00
Adjust prompt
This commit is contained in:
parent
5876695aa1
commit
686fdef665
@ -41,31 +41,34 @@ class GenAIClient:
|
|||||||
"""Generate a description for the review item activity."""
|
"""Generate a description for the review item activity."""
|
||||||
context_prompt = f"""
|
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, while also including **reasonable, evidence-based inferences** about the likely context or activity — but do not make unfounded assumptions.
|
|
||||||
|
Your task is to provide a **neutral, factual, and objective description** of the scene, while also:
|
||||||
|
- Clearly stating **what is happening** based on observable actions and movements.
|
||||||
|
- Including **reasonable, evidence-based inferences** about the likely activity or context, but only if directly supported by visible details.
|
||||||
|
|
||||||
When forming your description:
|
When forming your description:
|
||||||
- Base all statements on visible details in the images.
|
- **Facts first**: Describe the physical setting, people, and objects exactly as seen.
|
||||||
- You may deduce plausible intent or context only if supported by clear, observable evidence (e.g., someone carrying tools toward a car may indicate vehicle maintenance).
|
- **Then context**: Briefly note plausible purposes or activities (e.g., “appears to be delivering a package” if carrying a box to a door).
|
||||||
- Avoid implying hostility, criminal intent, or other strong judgments unless the visual evidence is unambiguous.
|
- Clearly separate certain facts (“A person is holding a ladder”) from reasonable inferences (“likely performing maintenance”).
|
||||||
- Distinguish between what is certain (facts) and what appears likely (reasonable inference).
|
- Do not speculate beyond what is visible, and do not imply hostility, criminal intent, or other strong judgments unless there is unambiguous visual evidence.
|
||||||
|
|
||||||
Here is some information we already know:
|
Here is information already known:
|
||||||
- The activity occurred at {review_data["timestamp"].strftime("%I:%M %p")}
|
- Activity occurred at {review_data["timestamp"].strftime("%I:%M %p")}
|
||||||
- The following objects were detected: {review_data["objects"]}
|
- Detected objects: {review_data["objects"]}
|
||||||
- The following recognized objects were detected: {review_data["recognized_objects"]}
|
- Recognized objects: {review_data["recognized_objects"]}
|
||||||
- The activity happened in the following zones: {review_data["zones"]}
|
- Zones involved: {review_data["zones"]}
|
||||||
|
|
||||||
Your response **MUST** be a flat JSON object with the following fields:
|
Your response **MUST** be a flat JSON object with:
|
||||||
- `scene` (string): A comprehensive description of the setting and entities, including relevant context and plausible inferences if supported by visual evidence.
|
- `scene` (string): A full description including setting, entities, actions, and any plausible supported inferences.
|
||||||
- `confidence` (float): A float between 0 and 1 representing your overall confidence in this analysis.
|
- `confidence` (float): A number 0–1 for overall confidence in the analysis.
|
||||||
- `potential_threat_level` (integer, optional): 1–3 scale. Only include if a clear security concern is visible:
|
- `potential_threat_level` (integer, optional): Include only if there is a clear, observable security concern:
|
||||||
- 1 = Unusual but not overtly threatening
|
- 1 = Unusual but not overtly threatening
|
||||||
- 2 = Suspicious or potentially harmful
|
- 2 = Suspicious or potentially harmful
|
||||||
- 3 = Clear and immediate threat
|
- 3 = Clear and immediate threat
|
||||||
Omit this field entirely if there is no observable security concern.
|
Omit this field if no concern is evident.
|
||||||
|
|
||||||
**IMPORTANT:**
|
**IMPORTANT:**
|
||||||
Values for each field must be plain strings or integers — no nested objects or explanatory text.
|
- Values must be plain strings, floats, or integers — no nested objects, no extra commentary.
|
||||||
"""
|
"""
|
||||||
response = self._send(context_prompt, thumbnails)
|
response = self._send(context_prompt, thumbnails)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user