|
|
@@ -394,7 +394,9 @@ class Coordinator:
|
|
|
def _coordinator_worker(self):
|
|
|
"""联动工作线程"""
|
|
|
last_detection_time = 0
|
|
|
- detection_interval = self.config.get('detection_interval', 1.0)
|
|
|
+ # 优先使用 detection_fps,默认每秒2帧
|
|
|
+ detection_fps = self.config.get('detection_fps', 2)
|
|
|
+ detection_interval = 1.0 / detection_fps # 根据FPS计算间隔
|
|
|
|
|
|
# 初始化统计
|
|
|
with self.stats_lock:
|
|
|
@@ -851,7 +853,9 @@ class AsyncCoordinator(Coordinator):
|
|
|
def _detection_worker(self):
|
|
|
"""检测线程:持续读帧 + YOLO推理 + 发送PTZ命令 + 打印检测日志"""
|
|
|
last_detection_time = 0
|
|
|
- detection_interval = self.config.get('detection_interval', 1.0)
|
|
|
+ # 优先使用 detection_fps,默认每秒2帧
|
|
|
+ detection_fps = self.config.get('detection_fps', 2)
|
|
|
+ detection_interval = 1.0 / detection_fps # 根据FPS计算间隔
|
|
|
ptz_cooldown = self.config.get('ptz_command_cooldown', 0.5)
|
|
|
ptz_threshold = self.config.get('ptz_position_threshold', 0.03)
|
|
|
frame_count = 0
|
|
|
@@ -870,7 +874,7 @@ class AsyncCoordinator(Coordinator):
|
|
|
elif not self.enable_detection:
|
|
|
logger.warning("[检测线程] ⚠️ 人体检测已禁用 (enable_detection=False)")
|
|
|
else:
|
|
|
- logger.info(f"[检测线程] ✓ 人体检测器已就绪, 检测间隔={detection_interval}s, PTZ冷却={ptz_cooldown}s")
|
|
|
+ logger.info(f"[检测线程] ✓ 人体检测器已就绪, 检测帧率={detection_fps}fps(间隔={detection_interval:.2f}s), PTZ冷却={ptz_cooldown}s")
|
|
|
|
|
|
while self.running:
|
|
|
try:
|