darknet2ncnn将darknet 模型转换为ncnn模型,实现darknet网络模型在移动端的快速部署
安装及使用
1.)Install opencv-dev, gcc, g++, make, cmake
2.)下载源码
git clone https://github.com/xiangweizeng/darknet2ncnn.git
3.)初始化 submodule
cd darknet2ncnn
git submodule init
git submodule update
4.)构建 darknet
cd darknet2 make -j8 rm libdarknet.so
5.)构建 ncnn
# workspace darknet2ncnn cd ncnn mkdir build cd build cmake .. make -j8 make install cd ../../
6.)构建 darknet2ncnn , convert_verify and libdarknet2ncnn.a
# workspace darknet2ncnn make -j8
7.)模型转换及验证
./darknet2ncnn data/yolov3-voc.cfg data/yolov3-voc_20_20000.weights example/zoo/yolov3-voc_20.param example/zoo/yolov3-voc_20.bin
./convert_verify data/yolov3-voc.cfg data/yolov3-voc_20_20000.weights
example/zoo/yolov3-voc_20.param example/zoo/yolov3-voc_20.bin
8.) 构建 example
# workspace darknet2ncnn cd example make -j2
9.) 运行
./yolo zoo/yolov3-voc_20.param zoo/yolov3-voc_20.bin data/pen_8.jpg data/coco.names