当前位置: 首页 > news >正文

模型部署:(四)安卓端部署Yolov8-v8.2.99实例分割项目全流程记录

模型部署:(四)安卓端部署Yolov8-v8.2.99实例分割项目全流程记录

  • 1、下载ncnn
  • 2、下载opencv-mobile
  • 3、文件拷贝
  • 4、andorid_studio相关配置
  • 5、文件内参数设置
  • 5、重构项目:
  • 6、打包apk

1、下载ncnn

地址:

https://github.com/Tencent/ncnn/tree/20230223

下载的版本是

ncnn-20230223-android-vulkan

在这里插入图片描述

在这里插入图片描述


在这里插入图片描述

2、下载opencv-mobile

下载的版本是:opencv-mobile-4.6.0-android
官网地址:

https://github.com/nihui/opencv-mobile/releases?page=2

在这里插入图片描述

3、文件拷贝

将上述下载的ncnn-20230223-android-vulkanopencv-mobile-4.6.0-android分别解压,拷贝到
目录D:\ncnn-android-yolov8-seg\app\src\main\jni

在这里插入图片描述


4、andorid_studio相关配置

我的这个版本是:Android Studio Flamingo | 2022.2.1 Patch 1
在这里插入图片描述


配置SDK Platforms

在这里插入图片描述

配置SDK Platforms

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

5、文件内参数设置

在这里插入图片描述

在这里插入图片描述

文件:build.gradle (Project)
在这里插入图片描述

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {jcenter()google()}dependencies {classpath 'com.android.tools.build:gradle:3.5.0'}
}allprojects {repositories {jcenter()google()}
}

文件:build.gradle (Module: app)

在这里插入图片描述

apply plugin: 'com.android.application'android {compileSdkVersion 24buildToolsVersion "29.0.2"defaultConfig {applicationId "com.tencent.yolov8ncnn"archivesBaseName = "$applicationId"minSdkVersion 24}externalNativeBuild {cmake {version "3.10.2"path file('src/main/jni/CMakeLists.txt')}}dependencies {implementation 'com.android.support:support-v4:24.0.0'}ndkVersion '24.0.8215888'
}

文件:gradle-wrapper.properties
在这里插入图片描述

#Sun Sep 08 23:09:42 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-5.4.1-all.zip

文件:local.properties

在这里插入图片描述

## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Fri Sep 12 17:47:07 CST 2025
cmake.dir=D\:\\Android_SDK\\Sdk\\cmake\\3.10.2.4988404
ndk.dir=D\:\\Android_SDK\\Sdk\\ndk\\24.0.8215888
sdk.dir=D\:\\Android_SDK\\Sdk

文件:settings.gradle

在这里插入图片描述

文件:CMakeLists.txt

在这里插入图片描述

5、重构项目:

在这里插入图片描述

6、打包apk

在这里插入图片描述

但是打包过程中会出现报错,提示信息如下:

Execution failed for task ':app:stripDebugDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

解决方案:
在这里插入图片描述

同时安装低版本的ndk(如version=21.0.6113669),将低版
本ndk中toolchains 文件夹下的arm-linux-androideabi等文件复制到高版
本ndk的toolchains 文件夹中

在这里插入图片描述
复制后如下所示::复制到24.0.8215888对应的目录下


在这里插入图片描述

再次重构,打包,效果如下所示:

在这里插入图片描述


文章转载自:

http://D6IrgK9x.tLpgp.cn
http://EAWVE0PR.tLpgp.cn
http://KrOdWvaV.tLpgp.cn
http://gxEuW0zN.tLpgp.cn
http://SLiel4IS.tLpgp.cn
http://oxuA9jcT.tLpgp.cn
http://vqDow2Sm.tLpgp.cn
http://Za1p88xt.tLpgp.cn
http://IGir1wqv.tLpgp.cn
http://LAFbENww.tLpgp.cn
http://UhM26I5n.tLpgp.cn
http://3PYGg9j4.tLpgp.cn
http://mS304baC.tLpgp.cn
http://8SoBTYgV.tLpgp.cn
http://kYOUperb.tLpgp.cn
http://mdiidecO.tLpgp.cn
http://rIYnrzoe.tLpgp.cn
http://ZJi0zMGG.tLpgp.cn
http://oTWILOrw.tLpgp.cn
http://ddNts01e.tLpgp.cn
http://ooTDF6MK.tLpgp.cn
http://JPoI1y0x.tLpgp.cn
http://LblnLxNg.tLpgp.cn
http://eQiA3toz.tLpgp.cn
http://OtlwOLOV.tLpgp.cn
http://m5YQcgZb.tLpgp.cn
http://azrFec7T.tLpgp.cn
http://hNl34X9s.tLpgp.cn
http://Z4XsL23J.tLpgp.cn
http://d4I9YxCC.tLpgp.cn
http://www.dtcms.com/a/380286.html

相关文章:

  • 使用自定义LLM和Embedding模型部署Vanna:基于RAG的Text-to-SQL生成
  • DataCollatorForCompletionOnlyLM解析(93)
  • 淘宝RecGPT:通过LLM增强推荐
  • Vue3 中使用 DOMPurify 对渲染动态 HTML 进行安全净化处理
  • 比较 iPhone:全面比较 iPhone 17 系列
  • 【Doris】集群介绍
  • 从“能写”到“能干活”:大模型工具调用(Function-Calling)的工程化落地指南
  • golang程序内存泄漏分析方法论
  • Go 语言 MQTT 消息队列学习指导文档
  • 基于数据挖掘技术构建电信5G客户预测模型的研究与应用
  • 【AI】pickle模块常见用途
  • 智慧园区,智启未来 —— 重塑高效、绿色、安全的产业新生态
  • MySQL 8新特性
  • 腾讯开源Youtu-GraphRAG
  • QT M/V架构开发实战:QStringListModel介绍
  • 【数据结构】Java集合框架:List与ArrayList
  • 开发避坑指南(48):Java Stream 判断List元素的属性是否包含指定的值
  • postgresql 数据库备份、重新构建容器
  • 大数据电商流量分析项目实战:Spark SQL 基础(四)
  • vmware ubuntu18设置共享文件夹的几个重要点
  • 每日一题(5)
  • Lumerical licence center 无法连接的问题
  • Java网络编程(2):(socket API编程:UDP协议的 socket API -- 回显程序)
  • Java 类加载机制双亲委派与自定义类加载器
  • OpenLayers数据源集成 -- 章节九:必应地图集成详解
  • 前端调试工具有哪些?常用前端调试工具推荐、前端调试工具对比与最佳实践
  • 【C++练习】16.C++将一个十进制转换为二进制
  • 公司本地服务器上搭建部署的办公系统web项目网站,怎么让外网访问?有无公网IP下的2种通用方法教程
  • 【C++】string类 模拟实现
  • 【系列文章】Linux中的并发与竞争[02]-原子操作