|
@@ -952,19 +952,30 @@ class AsyncCoordinator(Coordinator):
|
|
|
if tracked and self._enable_paired_saving and self._paired_saver is not None:
|
|
if tracked and self._enable_paired_saving and self._paired_saver is not None:
|
|
|
self._create_detection_batch(frame, tracked, frame_size)
|
|
self._create_detection_batch(frame, tracked, frame_size)
|
|
|
|
|
|
|
|
- # 打印检测日志
|
|
|
|
|
|
|
+ # 打印检测日志(使用连续序号,与图片标记一致)
|
|
|
if tracked:
|
|
if tracked:
|
|
|
|
|
+ person_threshold = DETECTION_CONFIG.get('person_threshold', 0.8)
|
|
|
|
|
+ person_idx = 0
|
|
|
for t in tracked:
|
|
for t in tracked:
|
|
|
# tracked 是 DetectedObject,使用 center 计算位置
|
|
# tracked 是 DetectedObject,使用 center 计算位置
|
|
|
x_ratio = t.center[0] / frame_size[0]
|
|
x_ratio = t.center[0] / frame_size[0]
|
|
|
y_ratio = t.center[1] / frame_size[1]
|
|
y_ratio = t.center[1] / frame_size[1]
|
|
|
_, _, w, h = t.bbox
|
|
_, _, w, h = t.bbox
|
|
|
area = w * h
|
|
area = w * h
|
|
|
- logger.info(
|
|
|
|
|
- f"[检测] ✓ 目标ID={t.track_id} "
|
|
|
|
|
- f"位置=({x_ratio:.3f}, {y_ratio:.3f}) "
|
|
|
|
|
- f"面积={area} 置信度={t.confidence:.2f}"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ # 只对达到阈值的人员打印日志并分配序号
|
|
|
|
|
+ if t.class_name == 'person' and t.confidence >= person_threshold:
|
|
|
|
|
+ logger.info(
|
|
|
|
|
+ f"[检测] ✓ person_{person_idx} "
|
|
|
|
|
+ f"位置=({x_ratio:.3f}, {y_ratio:.3f}) "
|
|
|
|
|
+ f"面积={area} 置信度={t.confidence:.2f}"
|
|
|
|
|
+ )
|
|
|
|
|
+ person_idx += 1
|
|
|
|
|
+ else:
|
|
|
|
|
+ logger.debug(
|
|
|
|
|
+ f"[检测] · 目标ID={t.track_id}({t.class_name}) "
|
|
|
|
|
+ f"位置=({x_ratio:.3f}, {y_ratio:.3f}) "
|
|
|
|
|
+ f"置信度={t.confidence:.2f}(低于阈值{person_threshold})"
|
|
|
|
|
+ )
|
|
|
elif detections:
|
|
elif detections:
|
|
|
# 有检测但没跟踪上
|
|
# 有检测但没跟踪上
|
|
|
for d in detections:
|
|
for d in detections:
|