This model convertor ported from original supports conversion from darkent to caffe, especially for YOLOv2 and tiny-YOLO etc.
First, ensure caffe installed (converison progress'll use Python interface of caffe), recommanding using Docker image of bvlc/caffe:cpu instead.
Use following command, convert darknet model to caffe's:
python darknet2caffe.py DARKNET_CFG DARKNET_WEIGHTSIf 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_CAFFEMODELTranslate to InferXLite directly from darknet:
python darknet2inferx.py DARKNET_CFG DARKNET_WEIGHTSCheck exectuion log in darknet2caffe_convert.log.
Translate *.cfg file to *.prototxt only:
python cfg.py DARKNET_CFGDue 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 - 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
*.hfile. - support
yolo_poolingjudge/choose in pooling conversion from caffe to inferxlite [DELAY]
- support converison of region layer's parameters to variables in
- 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=2withstride=1 size=1beforecfg2proto. After conversion fromweightstocaffemodel, an afterward process'll replace pooling setting in cfg file using ground truth params (stride and size) in cfg file).
- 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