feat: trace debug — actual bbox thickness=4, interpolated bbox thickness=1 at first known position

This commit is contained in:
Accusys
2026-05-14 15:24:11 +08:00
parent d8dddda970
commit 6728c2bb90

View File

@@ -404,13 +404,22 @@ async fn trace_video(
y_pos -= 22;
}
// Green thin bounding boxes with trace_id label for each face detection
// Bounding boxes: interpolated (thickness=1) + actual (thickness=4) with trace_id label
for (tid, frames) in &sorted_traces {
let range_enable = format!("between(n,{},{})", frames[0] as i64 - frame_offset, frames[frames.len() - 1] as i64 - frame_offset);
// Interpolated bbox at first known position across the whole trace range
if let Some((x, y, w, h)) = bbox_per_frame.get(&(*tid, frames[0])) {
parts.push(format!(
"drawbox=x={}:y={}:w={}:h={}:color=green@0.3:thickness=1:enable='{}'",
x, y, w, h, range_enable
));
}
// Actual detection bboxes with trace_id label
for fn_ in frames.iter() {
if let Some((x, y, w, h)) = bbox_per_frame.get(&(*tid, *fn_)) {
let n = *fn_ as i64 - frame_offset;
parts.push(format!(
"drawbox=x={}:y={}:w={}:h={}:color=green@0.5:thickness=1:enable='between(n,{},{})'",
"drawbox=x={}:y={}:w={}:h={}:color=green@0.5:thickness=4:enable='between(n,{},{})'",
x, y, w, h, n, n
));
parts.push(format!(