Coder Social home page Coder Social logo

h5_to_weight_yolo3's Introduction

keras yolov3 h5 model file convert to darknet yolov3.weights

Introduction

This script according to https://github.com/qqwweee/keras-yolo3/blob/master/convert.py implementation yolov3 train saved h5 model convert to darknet yolov3.weights.

Check and modify files

  1. voc_classes.txt: Check there is not a line break in the file end, otherwise line break will regard as one class. Just delete the line break it will be ok.

  2. yolo.cfg: Modify the yolo.cfg corresponding to own train config, change the below items.

    width=960 # train image's width
    height=512 # train image's heigh

    ......
    filters=18 # 3*(5+num_classes)
    activation=linear

    [yolo]
    mask = 6,7,8
    anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
    classes=1 # classes number

    ......

    filters=18 # 3*(5+num_classes)
    activation=linear

    [yolo]
    mask = 3,4,5
    anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
    classes=1 # classes number

    ......

    filters=18 # 3*(5+num_classes)
    activation=linear

    [yolo]
    mask = 0,1,2
    anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326
    classes=1 # classes number

  3. open check_weight.py and modify model_path, config_path, weight_file of yourself.

model_path = "./trained_weights_final.h5"     # keras yolov3 h5 model file
config_path = 'yolov3.cfg'                   # .cfg  file path
weight_file = open('yolov3.weights', 'wb')   # save darknet yolov3 weights file path

Convert start

run python check_weight.py

h5_to_weight_yolo3's People

Contributors

caimingxie avatar

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.