ncnn编译依赖OpenCV和protobuf
一、安装OnenCV
下载 Releases · opencv/opencv · GitHub
以OpenCV 4.5.4为例,下载Source code (zip),
复制代码
1
2
3
4
5
6
7
8
9
10##源码编译 unzip opencv-4.5.4.zip cd opencv-4.5.4 mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. make -j8 sudo make install sudo ldconfig
二、安装protobuf
下载Releases · protocolbuffers/protobuf · GitHub
以3.19.1为例
复制代码
1
2
3
4
5
6unzip protobuf-all-3.19.1.zip cd protobuf-all-3.19.1 ./configure --prefix=/usr/local make -j4 sudo make install sudo ldconfig
三、安装NCNN
1、编译NCNN
复制代码
1
2
3
4
5
6
7git clone https://github.com/Tencent/ncnn.git cd ncnn mkdir build cd build cmake .. make make install
2.ONNX转换NCNN
ncnn编译完后,在build/tools/onnx里会生成个可执行文件onnx2ncnn
复制代码
1./onnx2ncnn mobilenetv2.onnx mobilenetv2.param mobilenetv2.bin
最后
以上就是整齐小蝴蝶最近收集整理的关于ONNX转换NCNN的全部内容,更多相关ONNX转换NCNN内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复