fix: face_tracker.py now supports list format for frames
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user