Improve object naming behavior

This commit is contained in:
Nicolas Mowen 2025-10-27 16:25:17 -06:00
parent 8a6cc7bb0d
commit 5de671c136
2 changed files with 8 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class GenAIReviewConfig(FrigateBaseModel):
- Taking items that don't belong to them (stealing packages, objects from porches/driveways)
- Climbing or jumping fences/barriers to access property
- Attempting to conceal actions or items from view
- Lingering without interaction: standing near vehicles/private zones across multiple frames without approaching, entering, leaving, or clear task
- Prolonged presence without purpose: remaining in same area (near vehicles, private zones) throughout most/all of the sequence without clear activity or task. Brief stops (a few seconds of standing) are normal; sustained presence (most of the duration) without interaction is concerning.
- Activity at unusual hours (very late night/early morning) combined with suspicious behavior patterns
### Critical Threat Indicators (Level 2)

View File

@ -99,7 +99,7 @@ When forming your description:
## Response Format
Your response MUST be a flat JSON object with:
- `title` (string): A concise, one-sentence title that captures the main activity. Use the exact names from "Objects in Scene" below (e.g., if the list shows "Joe (person)" and "Unrecognized (person)", say "Joe and an unrecognized person"). Examples: "Joe walking dog in backyard", "Unrecognized person delivering package", "Joe and an unrecognized person in driveway".
- `title` (string): A concise, one-sentence title that captures the main activity. Use names from "Objects in Scene" based on what you visually observe. If you see both a recognized name and "Unrecognized" for the same type but visually observe only one person/object, use ONLY the recognized name. Examples: "Joe walking dog in backyard", "Britt near vehicle in driveway", "Joe and an unrecognized person on front porch".
- `scene` (string): A narrative description of what happens across the sequence from start to finish. **Only describe actions you can actually observe happening in the frames provided.** Do not infer or assume actions that aren't visible (e.g., if you see someone walking but never see them sit, don't say they sat down). Include setting, detected objects, and their observable actions. Avoid speculation or filling in assumed behaviors. Your description should align with and support the threat level you assign.
- `confidence` (float): 0-1 confidence in your analysis. Higher confidence when objects/actions are clearly visible and context is unambiguous. Lower confidence when the sequence is unclear, objects are partially obscured, or context is ambiguous.
- `potential_threat_level` (integer): 0, 1, or 2 as defined below. Your threat level must be consistent with your scene description and the guidance above.
@ -119,7 +119,11 @@ Your response MUST be a flat JSON object with:
## Objects in Scene
Each line represents one object in the scene. Named objects are recognized/verified identities; "Unrecognized" indicates objects detected but not identified. **Note: "Unrecognized" is NOT an indicator of suspicious activityit simply means the system hasn't identified that object.**
Each line represents a detection state, not necessarily unique individuals. Named objects are recognized/verified identities; "Unrecognized" indicates objects detected but not identified.
**CRITICAL: When you see both recognized and unrecognized entries of the same type (e.g., "Name (person)" and "Unrecognized (person)"), visually count how many distinct people/objects you actually see based on appearance and clothing. If you observe only ONE person throughout the sequence, use ONLY the recognized name (e.g., "Name"), not "Unrecognized". The same person may be recognized in some frames but not others. Only describe both recognized and unrecognized if you visually see MULTIPLE distinct people with clearly different appearances.**
**Note: "Unrecognized" is NOT an indicator of suspicious activityit simply means the system hasn't identified that object.**
{get_objects_list()}
## Important Notes
@ -161,7 +165,7 @@ Each line represents one object in the scene. Named objects are recognized/verif
metadata = ReviewMetadata.model_validate_json(clean_json)
if any(
not obj.startswith("Unknown")
not obj.startswith("Unrecognized")
for obj in review_data["unified_objects"]
):
metadata.potential_threat_level = 0