ysh329 / darknet2caffe

Convert Darknet model to Caffe's
BSD 3-Clause "New" or "Revised" License
49 stars 21 forks source link
caffe conversion darknet support-conversion tiny-yolo yolov2

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