feat: 新增人员徘徊/静止行为分析功能

本次提交实现了完整的人员行为分析系统,包括:
1. 新增基于位置和跟踪ID的两种行为检测算法
2. 新增徘徊检测服务与行为处理器模块
3. 前后端集成算法配置界面与告警展示
4. 支持图片和视频流场景下的行为分析
5. 新增算法配置接口与文档说明

具体改动:
- 新增loitering_detection模型目录与算法实现
- 新增AlgorithmConfig组件实现可视化配置
- 扩展图片/视频检测接口支持算法参数传递
- 新增行为告警推送与前端展示页面
- 优化检测服务,集成行为分析逻辑
- 移除冗余日志输出,完善代码注释
This commit is contained in:
wwh
2026-05-19 09:17:09 +08:00
parent 2691761f01
commit 7aa71c5f83
15 changed files with 1937 additions and 76 deletions

View File

@@ -249,11 +249,21 @@ class CameraService:
logger.info(f"发送检测结果: {len(result['detections'])} 个目标, {result['stats']}")
await websocket.send_json({
detection_message = {
'type': 'detection',
'detections': result['detections'],
'stats': result['stats']
})
}
# 包含行为告警信息
if 'alerts' in result and result['alerts']:
detection_message['alerts'] = result['alerts']
logger.info(f"发送告警: {len(result['alerts'])}")
if 'behavior_stats' in result:
detection_message['behavior_stats'] = result['behavior_stats']
await websocket.send_json(detection_message)
_, buffer = cv2.imencode('.jpg', frame, [cv2.IMWRITE_JPEG_QUALITY, 80])
import base64