darknet2ncnn
darknet2ncnn将darknet 模型转换为ncnn模型,实现darknet网络模型在移动端的快速部署
安装及使用
1.)Install opencv-dev, gcc, g++, make, cmake
2.)下载源码
git clone https://github.com/xiangweizeng/darknet2ncnn.git
3.)初始化 submodule
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
cd darknet2ncnn
git submodule init
git submodule update
4.)构建 darknet
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
cd darknet2 make -j8 rm libdarknet.so
5.)构建 ncnn
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
# workspace darknet2ncnn cd ncnn mkdir build cd build cmake .. make -j8 make install cd ../../
6.)构建 darknet2ncnn , convert_verify and libdarknet2ncnn.a
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
# 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
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
# 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
![](https://img2020.cnblogs.com/blog/1177559/202104/1177559-20210420201124918-63867628.png)