Map verified objects to their sub label directly (#20413)
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled

* Map verified objects to their sub label directly

* Simplify access

* Cleanup

* Add protection for mismatched object and index

* Keep track of verified objects separately
This commit is contained in:
Nicolas Mowen
2025-10-10 08:07:00 -05:00
committed by GitHub
parent 24a1874225
commit b1a5896b53
3 changed files with 23 additions and 8 deletions
+8 -1
View File
@@ -63,6 +63,12 @@ class GenAIClient:
else:
return ""
def get_verified_objects() -> str:
if review_data["recognized_objects"]:
return " - " + "\n - ".join(review_data["recognized_objects"])
else:
return " None"
context_prompt = f"""
Please analyze the sequence of images ({len(thumbnails)} total) taken in chronological order from the perspective of the {review_data["camera"].replace("_", " ")} security camera.
@@ -102,7 +108,8 @@ Sequence details:
- Frame 1 = earliest, Frame {len(thumbnails)} = latest
- Activity started at {review_data["start"]} and lasted {review_data["duration"]} seconds
- Detected objects: {", ".join(review_data["objects"])}
- Verified recognized objects: {", ".join(review_data["recognized_objects"]) or "None"}
- Verified recognized objects (use these names when describing these objects):
{get_verified_objects()}
- Zones involved: {", ".join(z.replace("_", " ").title() for z in review_data["zones"]) or "None"}
**IMPORTANT:**