Code Monkey home page Code Monkey logo

yolov3.keras's Introduction

yolov3.pytorch For VOC2007


说明

本库是NWAFU校企实训中《基于VOC2007的常见物体的目标检测及其网络架构的设计与实现》项目,主要是使用YOLOv3进行目标检测,通过数据扩充,网络结构调整,超参数调整等对模型进行改进,尽可能提升模型准确率。

具体操作如下:

  1. YOLO website下载权重。
  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尺寸

  1. 使用多个GPU: use --gpu_num N

效果

results

训练

  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 冻结了其他层,只训练最后一层,所以训练速度很快。

yolov3.keras's People

Contributors

pprp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yolov3.keras's Issues

yolov3 pascal voc weights

hello @pprp
it's not an issue, sorry for that.
l just need your trained keras model on voc to use it for prediction, can you upload it please !
thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.