# keras-yolo3
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
## Introduction
A Keras implementation of YOLOv3 (Tensorflow backend) inspired by [allanzelener/YAD2K](https://github.com/allanzelener/YAD2K).
---
## Quick Start
1. Download YOLOv3 weights from [YOLO website](http://pjreddie.com/darknet/yolo/).
2. Convert the Darknet YOLO model to a Keras model.
3. Run YOLO detection.
```
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)]
```
For Tiny YOLOv3, just do in a similar way, just specify model path and anchor path with `--model model_file` and `--anchors anchor_file`.
### Usage
Use --help to see usage of yolo_video.py:
```
usage: yolo_video.py [-h] [--model MODEL] [--anchors ANCHORS]
[--classes CLASSES] [--gpu_num GPU_NUM] [--image]
[--input] [--output]
positional arguments:
--input Video input path
--output Video output path
optional arguments:
-h, --help show this help message and exit
--model MODEL path to model weight file, default model_data/yolo.h5
--anchors ANCHORS path to anchor definitions, default
model_data/yolo_anchors.txt
--classes CLASSES path to class definitions, default
model_data/coco_classes.txt
--gpu_num GPU_NUM Number of GPU to use, default 1
--image Image detection mode, will ignore all positional arguments
```
---
4. MultiGPU usage: use `--gpu_num N` to use N GPUs. It is passed to the [Keras multi_gpu_model()](https://keras.io/utils/#multi_gpu_model).
## Training
1. Generate your own annotation file and class names file.
One row for one image;
Row format: `image_file_path box1 box2 ... boxN`;
Box format: `x_min,y_min,x_max,y_max,class_id` (no space).
For VOC dataset, try `python voc_annotation.py`
Here is an example:
```
path/to/img1.jpg 50,100,150,200,0 30,50,200,120,3
path/to/img2.jpg 120,300,250,600,2
...
```
2. Make sure you have run `python convert.py -w yolov3.cfg yolov3.weights model_data/yolo_weights.h5`
The file model_data/yolo_weights.h5 is used to load pretrained weights.
3. Modify train.py and start training.
`python train.py`
Use your trained weights or checkpoint weights with command line option `--model model_file` when using yolo_video.py
Remember to modify class path or anchor path, with `--classes class_file` and `--anchors anchor_file`.
If you want to use original pretrained weights for YOLOv3:
1. `wget https://pjreddie.com/media/files/darknet53.conv.74`
2. rename it as darknet53.weights
3. `python convert.py -w darknet53.cfg darknet53.weights model_data/darknet53_weights.h5`
4. use model_data/darknet53_weights.h5 in train.py
---
## Some issues to know
1. The test environment is
- Python 3.5.2
- Keras 2.1.5
- tensorflow 1.6.0
2. Default anchors are used. If you use your own anchors, probably some changes are needed.
3. The inference result is not totally the same as Darknet but the difference is small.
4. The speed is slower than Darknet. Replacing PIL with opencv may help a little.
5. Always load pretrained weights and freeze layers in the first stage of training. Or try Darknet training. It's OK if there is a mismatch warning.
6. The training strategy is for reference only. Adjust it according to your dataset and your goal. And add further strategy if needed.
7. For speeding up the training process with frozen layers train_bottleneck.py can be used. It will compute the bottleneck features of the frozen model first and then only trains the last layers. This makes training on CPU possible in a reasonable time. See [this](https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html) for more information on bottleneck features.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业设计是高等教育阶段学生完成学业的一个重要环节,通常在学士或硕士学业即将结束时进行。这是学生将在整个学业中所学知识和技能应用到实际问题上的机会,旨在检验学生是否能够独立思考、解决问题,并展示其专业能力的一项综合性任务。 毕业设计的主要特点包括: 独立性: 毕业设计要求学生具备独立思考和解决问题的能力。学生需要选择一个合适的课题,研究相关文献,进行实地调查或实验,并提出独立见解。 实践性: 毕业设计是将理论知识应用到实际问题中的一次实践。通过完成毕业设计,学生能够将所学的专业知识转化为实际的解决方案,加深对专业领域的理解。 综合性: 毕业设计往往要求学生运用多个学科的知识,综合各种技能。这有助于培养学生的综合素养,提高他们的综合能力。 导师指导: 学生在毕业设计过程中通常由一名指导老师或导师团队提供指导和支持。导师负责引导学生确定研究方向、制定计划、提供建议,并在整个过程中监督进展。 学术规范: 毕业设计要求学生按照学术规范完成研究,包括文献综述、研究设计、数据采集与分析、结论和讨论等环节。学生需要撰写一篇完整的毕业论文,并进行答辩。
资源推荐
资源详情
资源评论
收起资源包目录
本科毕业设计内容,临时仓库.zip (54个子文件)
SJT-code
voc_annotation.py 1KB
train_sample.txt 16KB
yolo_video.py 2KB
draw_bbox.py 3KB
data_augmentation.py 18KB
2007_val.txt 265KB
train04.txt 39KB
font
FiraMono-Medium.otf 124KB
SIL Open Font License.txt 4KB
train02.txt 46KB
train05.txt 17KB
LICENSE 1KB
coco_annotation.py 1KB
model_data
train04_classes.txt 67B
yolo_anchors.txt 75B
train05_classes.txt 24B
train12_anchors.txt 77B
train02_classes.txt 79B
train06_classes.txt 24B
train06_anchors.txt 76B
train05_anchors.txt 77B
train04_anchors.txt 77B
train07_anchors.txt 75B
train02_anchors.txt 76B
coco_classes.txt 624B
tiny_yolo_anchors.txt 50B
train01_anchors.txt 77B
voc_classes.txt 134B
train01.txt 16KB
convert.py 10KB
2007_test.txt 515KB
train07.py 10KB
2007_train.txt 264KB
train06.txt 149KB
darknet53.cfg 6KB
train08.py 9KB
test.txt 1KB
yolov3.cfg 8KB
get_annotation.py 1KB
.gitignore 1KB
yolov3-tiny.cfg 2KB
train12.py 10KB
train09.py 9KB
kmeans.py 3KB
train_bottleneck.py 10KB
train.py 10KB
train10.py 10KB
train07.txt 700KB
yolo3
utils.py 4KB
__init__.py 0B
model.py 16KB
README.md 4KB
train12.txt 1.37MB
yolo.py 8KB
共 54 条
- 1
资源评论
JJJ69
- 粉丝: 6212
- 资源: 5783
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于pytorch+Unet进行MRI肝脏图像分割源码+数据集+模型.zip
- 在Android Studio中开发一个Android App项目步骤
- 基于yolov8实现进行物体跟踪源码.zip
- Java多线程学习Java多线程学习Java多线程学习Java多线程学习.txt
- 算法数据结构-动态规划算法(Dynamic Programming)超详细总结加应用案例讲解.txt
- 2024最强秋招八股文(精简、纯手打)2024最强秋招八股文(精简、纯手打).txt
- 基于tensorflow多特征融合的微表情识别python源码.zip
- 基于yolov8实现人脸检测的python源码+运行说明.zip
- Micron Memory DDR3 SDRAM 全系列AD集成库(原理图库+PCB封装库).IntLib
- 基于tensorflow多特征融合的微表情识别python源码+详细使用说明.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功