yolov5s-v3.1 ncnn 部署(一)

目录

ncnn在windows下编译

第一步:安装VS2017

第二步:下载ncnn和protobuf源码

第三步:Start the command prompt

 第三步:build protobuf library

第四步:安装Vulkan

第五步:Build ncnn library (replace with a proper path)


ncnn在windows下编译

参考官网:https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017

第一步:安装VS2017

因为我的电脑本来装了VS2019,所以直接用VS2019试一下~

Download and Install Visual Studio Community 2017 from Visual Studio 2019 Community Edition – Download Latest Free Version

第二步:下载ncnn和protobuf源码

Download protobuf-3.4.0 from https://github.com/google/protobuf/archive/v3.4.0.zip

Download ncnn from github: https://github.com/Tencent/ncnn

$ git clone https://github.com/Tencent/ncnn.git
$ cd ncnn
$ git submodule update --init

第三步:Start the command prompt

官网给的是用x64 Native Tools Command Prompt for VS 2017编译,我用的是x64 Native Tools Command Prompt for VS 2019也可!这里注意使用x64进行编译不要用x86 Native Tools Command Prompt for VS 2019!!!

Start the command prompt: Start → Programs → Visual Studio 2019 → Visual Studio Tools → x64 Native Tools Command Prompt for VS 2019如下图:

 第三步:build protobuf library

cd <protobuf-root-dir>
mkdir build
cd build
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake
nmake
nmake install

第四步:安装Vulkan

Download and install Vulkan SDK from LunarXchange

 正常下载安装到一个自己感觉舒服的位置上

第五步:Build ncnn library (replace with a proper path)

build ncnn 注意替换命令中的protobuf的路径为自己的protobuf的路径

cd <ncnn-root-dir>
mkdir -p build
cd build
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=<protobuf-root-dir>/build/install/include -DProtobuf_LIBRARIES=<protobuf-root-dir>/build/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=<protobuf-root-dir>/build/install/bin/protoc.exe -DNCNN_VULKAN=ON ..
nmake
nmake install

Note: To speed up compilation process on multi core machines, configuring cmake to use jom or ninja using -G flag is recommended.

至此ncnn就编译完成了,待用

接下来去转模型pt2onnx2ncnn,转到下一篇“yolov5s-v3.1 ncnn 部署(二)”

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月亮299

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值