yolov3.keras-master
所属分类:其他
开发工具:Python
文件大小:4324KB
下载次数:1
上传日期:2021-03-29 19:34:36
上 传 者:
曲明
说明: python中训练文件,包含一个完整的yolo项目代码
(Python training files, including a complete YOLO project code)
文件列表:
2007_test.txt (107133, 2019-07-25)
2007_train.txt (267873, 2019-07-25)
2007_val.txt (268475, 2019-07-25)
LICENSE (1064, 2019-07-25)
VOCdevkit (0, 2019-07-25)
VOCdevkit\VOC2007 (0, 2019-07-25)
VOCdevkit\VOC2007\Annotations (0, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000005.xml (1557, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000007.xml (663, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000009.xml (1318, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000012.xml (638, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000016.xml (642, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000017.xml (873, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000019.xml (867, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000020.xml (661, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000021.xml (2815, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000023.xml (1778, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000024.xml (653, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000026.xml (639, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000030.xml (1094, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000032.xml (1323, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000033.xml (1100, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000034.xml (874, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000035.xml (1337, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000036.xml (645, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000039.xml (668, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000041.xml (1097, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000042.xml (885, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000044.xml (865, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000046.xml (654, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000047.xml (892, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000048.xml (869, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000050.xml (2698, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000051.xml (1133, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000052.xml (1819, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000060.xml (1509, 2019-07-25)
VOCdevkit\VOC2007\Annotations\000061.xml (881, 2019-07-25)
... ...
# yolov3.pytorch For VOC2007
---
## 说明
本库是NWAFU校企实训中《基于VOC2007的常见物体的目标检测及其网络架构的设计与实现》项目,主要是使用YOLOv3进行目标检测,通过数据扩充,网络结构调整,超参数调整等对模型进行改进,尽可能提升模型准确率。
具体操作如下:
1. 从 [YOLO website](http://pjreddie.com/darknet/yolo/)下载权重。
2. 使用convert.py将darknet的权重转化为keras权重
3. 进行预测
```
wget https://pjreddie.com/media/files/yolov3.weights
python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5
python yolo_video.py [OPTIONS...] --image, for image detection mode, OR
python yolo_video.py [video_path] [output_path (optional)]
```
`--model model_file` 和 `--anchors anchor_file` 分别用来制定模型路径与anchor尺寸
4. 使用多个GPU: use `--gpu_num N`
## 效果
![results](./results.png)
## 训练
1. 创建类文件和标注文件
运行 `python voc_annotation.py`
得到的例子:
```
path/to/img1.jpg 50,100,150,200,0 30,50,200,120,3
path/to/img2.jpg 120,300,250,600,2
...
```
2. 运行 `python convert.py -w yolov3.cfg yolov3.weights model_data/yolo_weights.h5` 来获取预训练文件model_data/yolo_weights.h5
3. 修改train.py
`python train.py`
如果想用YOLOv3的基础网络作为与训练模型,执行以下步骤:
1. `wget https://pjreddie.com/media/files/darknet53.conv.74` 获取模型
2. 重命名为 darknet53.weights
3. `python convert.py -w darknet53.cfg darknet53.weights model_data/darknet53_weights.h5` 将模型转化为h5文件
4. 修改 train.py 指定使用model_data/darknet53_weights.h5作为预训练模型。
---
## 其他
1. 主要环境要求
- Python 3.6+
- Keras 2.1.5
- tensorflow 1.6.0
2. 目前使用的是默认原版darknet中提供的anchor尺寸,具体可以在model/yolo_anchors.txt中进行修改
3. 在加载与训练权重的过程中会存在一些层无法加载进去的问题。
4. 可以根据需要对训练过程中的超参进行修改。
5. The training strategy is for reference only. Adjust it according to your dataset and your goal. And add further strategy if needed.
6. train_bottleneck.py 冻结了其他层,只训练最后一层,所以训练速度很快。
近期下载者:
相关文件:
收藏者: