ncnn
文章平均质量分 77
下大禹了
这个作者很懒,什么都没留下…
展开
-
ncnn填坑记录八:将自己训练的模型打包为APK并部署到安卓端运行
上一篇:ncnn填坑记录七:examples/squeezenet.cpp代码阅读做一个分类任务,模型选取的mobilenetv3,训练好模型,并按前文依次转换为onnx、ncnn后,参考官方https://github.com/nihui/ncnn-android-squeezenet进行修改。一. 在PC端运行ncnn/examples文件夹下:squeezenet.cpp -->mobilenetv3.cpp修改如下:#include "net.h"#include <alg原创 2021-06-22 18:13:11 · 2343 阅读 · 6 评论 -
ncnn填坑记录七:examples/squeezenet.cpp代码阅读
上一篇:ncnn填坑记录六:Android Studio打包APK#include "net.h"#include <algorithm>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>#include <stdio.h>#include <vector>static int detect_squeezenet(const cv::Mat&原创 2021-06-03 15:30:39 · 602 阅读 · 2 评论 -
ncnn填坑记录六:Android Studio打包APK
上一篇:ncnn填坑记录五:在安卓端运行ncnn选择APK>Next第一次需要Create newKey store path选择个地址,密码全填一样方便记,Certificate需要填一项,随便写个即可Next后,选择release,上面修改生成的apk保存地址Signature Versions 签名选择V2finish后右下角提示点击locate即可定位到生成的apk文件此处生成的apk叫com.tencent.mobilenetssdncnn-release.apk,原创 2021-06-01 17:47:32 · 618 阅读 · 3 评论 -
ncnn填坑记录五:在安卓端运行ncnn
上一篇:ncnn填坑记录四:pytorch模型转ncnn一.安装Android Studio下载地址:https://developer.android.google.cn/参考https://blog.csdn.net/qq_33431368/article/details/85009758#t4进行安装,因版本不同,安装界面有一点不同,基本没啥问题。android-studio/bin/中有个studio.sh,启动即可,之后点安卓图标右键锁定到启动器,以后直接点击桌面左面图标即可。在sett原创 2021-06-01 17:14:38 · 3276 阅读 · 7 评论 -
ncnn填坑记录四:pytorch模型转ncnn
上一篇:ncnn填坑记录三:在pc端运行examples以torchvision自带的resnent18为例一.pytorch模型转为onnximport torchimport torchvisionimport torch.onnx# An instance of your modelmodel = torchvision.models.resnet18()# An example input you would normally provide to your model's fo原创 2021-06-01 15:52:20 · 2449 阅读 · 0 评论 -
ncnn填坑记录三:在pc端运行examples
上一篇:ncnn填坑记录二:安装ncnn一.以squeezenet为例1.ncnn/examples内只有squeezenet的权重文件,故以此为例,打开该文件夹下的CMakeLists.txt,许多博客建议在末尾部分添加如下内容:add_executable(squeezenet squeezenet.cpp) target_link_libraries(squeezenet ncnn ${OpenCV_LIBS}) 可能是以前的版本需要这么改,新版本官方应该修改了,不需要修改,可以将末尾部分原创 2021-05-31 15:41:16 · 1194 阅读 · 0 评论 -
ncnn填坑记录二:安装ncnn
上一篇:ncnn填坑记录一:安装protobuf、cmake和opencv1.下载ncnn代码github上下载太慢,可换码云下载git clone https://github.com/Tencent/ncnn.git或git clone https://gitee.com/Tencent/ncnn.git2.安装依赖项gitg++cmakeprotocol buffer (protobuf) headers files and protobuf compilervulkan he原创 2021-05-31 11:38:56 · 2751 阅读 · 4 评论 -
ncnn填坑记录一:安装protobuf、cmake和opencv
1.protobuf安装git clone https://gitee.com/arcy/protobuf.git # 网络不好才在码云下载,建议github或git clone https://github.com/protocolbuffers/protobuf.git 安装依赖项:sudo apt-get install autoconf automake libtool curl make g++ unzip libffi-dev -y安装cd protobuf/./autoge原创 2021-05-31 10:37:49 · 2249 阅读 · 1 评论