Initial commit: Video detection platform with YOLO models
Features: - Fire detection (YOLOv10) - Helmet detection (YOLOv8) - Crowd detection (YOLOv8) - Smoking detection (YOLOv8) - Loitering detection (YOLOv8) Tech Stack: - Frontend: Vue 3 + Vite + Element Plus - Backend: FastAPI + WebSocket - Monorepo: pnpm workspace + Turbo - Docker support included
This commit is contained in:
135
README.md
Normal file
135
README.md
Normal file
@@ -0,0 +1,135 @@
|
||||
# jc-video-web
|
||||
|
||||
视频模型检测平台 - 基于YOLO的实时视频检测系统
|
||||
|
||||
## 项目架构
|
||||
|
||||
```
|
||||
jc-video-web/
|
||||
├── apps/
|
||||
│ ├── web/ # 前端应用 (Vue 3 + Vite)
|
||||
│ └── server/ # 后端服务 (FastAPI)
|
||||
├── packages/
|
||||
│ └── shared-types/ # 前后端共享类型定义
|
||||
├── models/ # AI模型文件
|
||||
│ ├── fire_detection/ # 火灾检测模型
|
||||
│ ├── helmet_detection/ # 安全帽检测模型
|
||||
│ ├── crowd_detection/ # 人群检测模型
|
||||
│ └── smoking_detection/# 抽烟检测模型
|
||||
├── scripts/ # 构建/开发脚本
|
||||
└── docker/ # Docker配置
|
||||
```
|
||||
|
||||
## 技术栈
|
||||
|
||||
### 前端
|
||||
- **框架**: Vue 3 + Composition API
|
||||
- **构建工具**: Vite 5
|
||||
- **UI组件库**: Element Plus
|
||||
- **状态管理**: Pinia
|
||||
- **路由**: Vue Router 4
|
||||
- **HTTP客户端**: Axios
|
||||
|
||||
### 后端
|
||||
- **框架**: FastAPI
|
||||
- **服务器**: Uvicorn
|
||||
- **AI推理**: Ultralytics (YOLO)
|
||||
- **图像处理**: OpenCV, Pillow
|
||||
- **实时通信**: WebSocket
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 环境要求
|
||||
- Node.js >= 18
|
||||
- Python >= 3.9
|
||||
- pnpm >= 9.0
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```bash
|
||||
# 运行初始化脚本
|
||||
bash scripts/setup.sh
|
||||
```
|
||||
|
||||
或手动安装:
|
||||
|
||||
```bash
|
||||
# 安装根依赖
|
||||
pnpm install
|
||||
|
||||
# 安装前端依赖
|
||||
cd apps/web
|
||||
pnpm install
|
||||
cd ../..
|
||||
|
||||
# 创建 Python 虚拟环境并安装依赖
|
||||
cd apps/server
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
cd ../..
|
||||
```
|
||||
|
||||
### 开发模式
|
||||
|
||||
```bash
|
||||
# 同时启动前后端
|
||||
pnpm dev
|
||||
|
||||
# 只启动前端
|
||||
pnpm dev:web
|
||||
|
||||
# 只启动后端
|
||||
pnpm dev:server
|
||||
```
|
||||
|
||||
访问地址:
|
||||
- 前端: http://localhost:5173
|
||||
- 后端: http://localhost:8000
|
||||
- API文档: http://localhost:8000/docs
|
||||
|
||||
## 功能特性
|
||||
|
||||
### 检测模型
|
||||
1. **火灾检测** - 基于YOLOv10的火焰和烟雾检测
|
||||
2. **安全帽检测** - 基于YOLOv8的工地安全检测
|
||||
3. **人群检测** - 基于YOLOv8的人群聚集检测
|
||||
4. **抽烟检测** - 基于YOLOv8的吸烟行为检测
|
||||
|
||||
### 输入方式
|
||||
- 图片上传检测
|
||||
- 摄像头实时检测
|
||||
|
||||
### 核心功能
|
||||
- 可拖拽布局配置
|
||||
- 实时WebSocket视频流
|
||||
- 检测结果可视化
|
||||
- 多模型切换
|
||||
- 置信度阈值调整
|
||||
|
||||
## 项目脚本
|
||||
|
||||
```bash
|
||||
pnpm dev # 启动开发服务器
|
||||
pnpm build # 构建生产版本
|
||||
pnpm build:web # 只构建前端
|
||||
pnpm test # 运行测试
|
||||
pnpm lint # 代码检查
|
||||
pnpm clean # 清理构建产物
|
||||
```
|
||||
|
||||
## 模型配置
|
||||
|
||||
模型文件存放在 `models/` 目录下,需要在 `apps/server/services/model_service.py` 中配置模型路径。
|
||||
|
||||
## 贡献指南
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
||||
4. 推送分支 (`git push origin feature/AmazingFeature`)
|
||||
5. 创建 Pull Request
|
||||
|
||||
## 许可证
|
||||
|
||||
[MIT](LICENSE)
|
||||
Reference in New Issue
Block a user