2026-01-20 17:42:18 +08:00
|
|
|
|
# 安保异常行为识别系统 - 核心配置
|
|
|
|
|
|
|
2026-01-21 13:29:00 +08:00
|
|
|
|
# 云端同步配置
|
|
|
|
|
|
cloud:
|
|
|
|
|
|
enabled: false # 启用云端同步(云端为主、本地为辅)
|
|
|
|
|
|
api_url: "https://api.example.com" # 云端API地址
|
|
|
|
|
|
api_key: "your-api-key" # API密钥
|
|
|
|
|
|
device_id: "EDGE-001" # 设备唯一标识
|
|
|
|
|
|
sync_interval: 60 # 配置同步间隔(秒)
|
|
|
|
|
|
alarm_retry_interval: 60 # 报警重试间隔(秒)
|
|
|
|
|
|
status_report_interval: 60 # 状态上报间隔(秒)
|
|
|
|
|
|
max_retries: 3 # 最大重试次数
|
|
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 数据库配置
|
|
|
|
|
|
database:
|
|
|
|
|
|
dialect: "sqlite" # sqlite 或 mysql
|
|
|
|
|
|
host: "localhost"
|
|
|
|
|
|
port: 3306
|
|
|
|
|
|
username: "root"
|
|
|
|
|
|
password: "password"
|
|
|
|
|
|
name: "security_monitor"
|
|
|
|
|
|
echo: true # SQL日志输出
|
|
|
|
|
|
|
|
|
|
|
|
# TensorRT模型配置
|
2026-01-12 17:38:39 +08:00
|
|
|
|
model:
|
2026-01-21 13:29:00 +08:00
|
|
|
|
engine_path: "models/yolo11n.engine"
|
|
|
|
|
|
onnx_path: "models/yolo11n.onnx"
|
2026-01-20 17:42:18 +08:00
|
|
|
|
pt_model_path: "models/yolo11n.pt"
|
2026-01-21 13:29:00 +08:00
|
|
|
|
imgsz: [640, 640]
|
2026-01-12 17:38:39 +08:00
|
|
|
|
conf_threshold: 0.5
|
2026-01-20 17:42:18 +08:00
|
|
|
|
iou_threshold: 0.45
|
2026-01-21 13:29:00 +08:00
|
|
|
|
device: 0
|
|
|
|
|
|
batch_size: 8
|
|
|
|
|
|
half: false
|
|
|
|
|
|
use_onnx: true
|
2026-01-12 17:38:39 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# RTSP流配置
|
|
|
|
|
|
stream:
|
|
|
|
|
|
buffer_size: 2 # 每路摄像头帧缓冲大小
|
|
|
|
|
|
reconnect_delay: 3.0 # 重连延迟(秒)
|
|
|
|
|
|
timeout: 10.0 # 连接超时(秒)
|
2026-01-21 13:29:00 +08:00
|
|
|
|
fps_limit: 10.0 # 最大处理FPS
|
2026-01-14 17:12:16 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 推理队列配置
|
|
|
|
|
|
inference:
|
|
|
|
|
|
queue_maxlen: 100 # 检测结果队列最大长度
|
|
|
|
|
|
event_queue_maxlen: 1000 # 异常事件队列最大长度
|
|
|
|
|
|
worker_threads: 4 # 处理线程数
|
2026-01-12 17:38:39 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 告警配置
|
|
|
|
|
|
alert:
|
|
|
|
|
|
snapshot_path: "data/alerts"
|
|
|
|
|
|
cooldown_sec: 300 # 同类型告警冷却时间
|
|
|
|
|
|
image_quality: 85 # JPEG质量
|
2026-01-12 17:38:39 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# ROI配置
|
|
|
|
|
|
roi:
|
|
|
|
|
|
default_types:
|
|
|
|
|
|
- "polygon"
|
|
|
|
|
|
- "line"
|
|
|
|
|
|
max_points: 50 # 多边形最大顶点数
|
2026-01-12 17:38:39 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 工作时间配置(全局默认)
|
|
|
|
|
|
working_hours:
|
|
|
|
|
|
- start: [8, 30] # 8:30
|
|
|
|
|
|
end: [11, 0] # 11:00
|
|
|
|
|
|
- start: [12, 0] # 12:00
|
|
|
|
|
|
end: [17, 30] # 17:30
|
2026-01-14 17:12:16 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 算法默认参数
|
|
|
|
|
|
algorithms:
|
|
|
|
|
|
leave_post:
|
2026-01-22 15:53:31 +08:00
|
|
|
|
threshold_sec: 300 # 离岗超时(5分钟)
|
|
|
|
|
|
confirm_sec: 10 # 上岗确认时间(10秒)
|
|
|
|
|
|
return_sec: 30 # 离岗缓冲时间(30秒)
|
2026-01-20 17:42:18 +08:00
|
|
|
|
intrusion:
|
|
|
|
|
|
check_interval_sec: 1.0 # 检测间隔
|
|
|
|
|
|
direction_sensitive: false # 方向敏感
|
2026-01-14 17:12:16 +08:00
|
|
|
|
|
2026-01-20 17:42:18 +08:00
|
|
|
|
# 日志配置
|
|
|
|
|
|
logging:
|
|
|
|
|
|
level: "INFO"
|
|
|
|
|
|
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
|
|
|
|
file: "logs/app.log"
|
|
|
|
|
|
max_size: "100MB"
|
|
|
|
|
|
backup_count: 5
|
|
|
|
|
|
|
|
|
|
|
|
# 监控配置
|
|
|
|
|
|
monitoring:
|
|
|
|
|
|
enabled: true
|
|
|
|
|
|
port: 9090 # Prometheus metrics端口
|
|
|
|
|
|
path: "/metrics"
|
|
|
|
|
|
|
|
|
|
|
|
# 大模型配置(预留)
|
|
|
|
|
|
llm:
|
|
|
|
|
|
enabled: false
|
2026-01-22 15:53:31 +08:00
|
|
|
|
api_key: "sk-21e61bef09074682b589da3bdbfe07a2"
|
|
|
|
|
|
base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
2026-01-20 17:42:18 +08:00
|
|
|
|
model: "qwen3-vl-max"
|
|
|
|
|
|
timeout: 30
|