33 行
891 B
Plaintext
33 行
891 B
Plaintext
## 项目结构
|
|
|
|
- `data_preparation.py`: 数据准备和预处理
|
|
- `train_model.py`: 模型训练
|
|
- `realtime_detection.py`: 实时摄像头检测
|
|
- `video_detection.py`: 视频文件检测
|
|
- `export_data.py`: 数据导出功能
|
|
- `utils.py`: 公用工具函数
|
|
- `config.py`: 配置文件
|
|
|
|
## 安装依赖
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
|
|
|
|
python data_preparation.py
|
|
python train_model.py
|
|
python realtime_detection.py
|
|
python video_detection.py
|
|
python export_data.py
|
|
|
|
|
|
|
|
## 使用说明
|
|
|
|
1. 安装依赖:`pip install -r requirements.txt`
|
|
2. 准备正样本和负样本图像到指定目录
|
|
3. 运行 `data_preparation.py` 创建描述文件
|
|
4. 运行 `train_model.py` 训练模型(需要较长时间)
|
|
5. 运行 `realtime_detection.py` 进行实时检测或 `video_detection.py` 进行视频检测
|
|
6. 使用 `export_data.py` 导出检测结果
|