# 店内停留报警项目中文说明 这个项目用于单路店内 RTSP 摄像头的人体检测、停留计时和本地 JSON 事件输出。 ## 功能 - 基于 `YOLO11n` 的店内人员检测与跟踪 - 停留时长统计 - 短暂离开后重关联 - 店员白名单排除 - 半小时统计 - 本地 `JSONL` 事件输出 - 安装完成后自动启动 - 开机自动启动 ## 目标机器 - `Ubuntu 24.04` - `Python 3.12` - NVIDIA 显卡可用 - `nvidia-smi` 可正常执行 ## 安装前需要修改 先编辑 `scripts/run.sh`,至少改这几个变量: - `RTSP_URL` - `CAMERA_ID` - `EVENT_SINK_PATH` ## 安装 在项目根目录执行: ```bash sudo bash scripts/install.sh ``` 安装脚本会自动: - 检查并安装 `ffmpeg` - 检查并安装 `python3.12-venv` - 创建 `.venv` - 离线安装 `wheelhouse/` 中的依赖 - 生成 `config/local.yaml` - 安装 `systemd` 服务 - 自动启动服务 - 设置开机自启 ## 服务管理 服务名: ```bash store-dwell-alert.service ``` 常用命令: ```bash sudo systemctl status store-dwell-alert.service sudo systemctl restart store-dwell-alert.service sudo systemctl stop store-dwell-alert.service sudo systemctl start store-dwell-alert.service sudo systemctl disable store-dwell-alert.service ``` ## 输出位置 - 运行日志:`logs/runtime.log` - 事件结果:`logs/events.jsonl` - 本地配置:`config/local.yaml` - 店员图库:`data/staff_gallery/`