fix: face_tracker.py now supports list format for frames

This commit is contained in:
Accusys
2026-09-27 01:14:28 +08:00
parent 921bcba43a
commit 696ede8696
4 changed files with 618 additions and 4 deletions
+21 -3
View File
@@ -210,10 +210,28 @@ def update_trace_ids(
payload = point.get("payload", {})
frame = payload.get("frame")
# Support two bbox formats:
# 1. Nested bbox field
# 2. Direct x, y, width, height fields
bbox = payload.get("bbox", {})
bbox_key = (
f"{bbox.get('x')}_{bbox.get('y')}_{bbox.get('width')}_{bbox.get('height')}"
)
if bbox:
# Format 1: has bbox field
x = bbox.get('x')
y = bbox.get('y')
width = bbox.get('width')
height = bbox.get('height')
else:
# Format 2: direct fields
x = payload.get('x')
y = payload.get('y')
width = payload.get('width')
height = payload.get('height')
if x is None or y is None or width is None or height is None:
continue
bbox_key = f"{x}_{y}_{width}_{height}"
trace_id = trace_mapping.get(frame, {}).get(bbox_key)
if trace_id is None: