Git Product home page Git Product logo

darknet2caffe-1's Introduction

darknet2inferx

This model convertor ported from original supports conversion from darkent to caffe, especially for YOLOv2 and tiny-YOLO etc.

Step1 Caffe Environment

First, ensure caffe installed (converison progress'll use Python interface of caffe), recommanding using Docker image of bvlc/caffe:cpu instead.

Step2 Convert

Use following command, convert darknet model to caffe's:

python darknet2caffe.py DARKNET_CFG DARKNET_WEIGHTS

If last message shows as below, it means successful conversion from darknet to caffe:

Network initialization done.

Next is conversion from caffe to InferXLite:

python caffe2inferx.py CAFFE_PROTOTXT CAFFE_CAFFEMODEL

Appendix

darknet2inferx

Translate to InferXLite directly from darknet:

python darknet2inferx.py DARKNET_CFG DARKNET_WEIGHTS

Check exectuion log in darknet2caffe_convert.log.

Translate *.cfg file to *.prototxt only:

python cfg.py DARKNET_CFG

Old API

Due to the newest API starting with inferx_ in *.c file (such as inferx_convolution), if use old API (without inferx_), you should convert to old API using command below:

python to_old_api_for_c_file.py INFERX_MODEL_C 

TODO

  • auto shape infer for output dimension of reorg layer from darknet to caffe, especially for one-reorg-layer networks like YOLOv2.
  • darknet2inferx
    • support converison of region layer's parameters to variables in *.h file.
    • support yolo_pooling judge/choose in pooling conversion from caffe to inferxlite [DELAY]
  • darknet2caffe
    • support conversion of pooling layer for a special case (input shape same as output shape. More concretely, stride=1 size=2 max pooling, this case's process of darknet will pad 1 for right and down side of input feature map. Thus, this conversion replaces stride=1 size=2 with stride=1 size=1 before cfg2proto. After conversion from weights to caffemodel, an afterward process'll replace pooling setting in cfg file using ground truth params (stride and size) in cfg file).

darknet2caffe-1's People

Contributors

ysh329 avatar

Watchers

James Cloos 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.