Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
chenzomi 24c9001cf8 | 1 year ago | |
---|---|---|
.. | ||
image_classification | 1 year ago | |
images | 1 year ago | |
readme.md | 1 year ago |
图像分类是MindSpore AI计算框架在端侧的典型应用场景。完成图像分类demo安装后,可利用已经训练好的预置模型在手机等设备上完成推理过程,对设备摄像头捕获的内容进行分类,并在App图像预览界面中显示出最可能的分类结果。
本实验主要介绍MindSpore Lite demo在手机端的部署方法,并在这一过程中完成端侧开发环境准备。
下载course课程仓库,或下载本课程目录下的code文件夹: course / lite_demo_deploy / code /
。在Android Studio中点击打开工程,加载本示例源码。
启动Android Studio后,点击File->Settings->System Settings->Android SDK
,勾选相应的SDK。如下图所示,勾选后,点击OK
,Android Studio即可自动安装SDK。
使用过程中若出现Android Studio配置问题,可参考下表解决:
报错 | 解决方案 | |
---|---|---|
1 | Gradle sync failed: NDK not configured. | 在local.properties中指定安装的ndk目录:ndk.dir={ndk的安装目录} |
2 | Requested NDK version did not match the version requested by ndk.dir | 可手动下载相应的NDK版本,并在Project Structure - Android NDK location设置中指定SDK的位置(可参考下图完成) |
3 | This version of Android Studio cannot open this project, please retry with Android Studio or newer. | 在工具栏-help-Checkout for Updates中更新版本 |
4 | SSL peer shut down incorrectly | 重新构建 |
连接Android设备,运行图像分类应用程序。
通过USB连接Android设备调试,点击Run 'app'
即可在您的设备上运行本示例项目。
编译过程中Android Studio会自动下载MindSpore Lite、模型文件等相关依赖项,编译过程需做耐心等待。
Android Studio连接设备调试操作,可参考https://developer.android.com/studio/run/device?hl=zh-cn。
手机需开启“USB调试模式”,Android Studio 才能识别到手机。 华为手机一般在设置->系统和更新->开发人员选项->USB调试中开始“USB调试模型”。
在Android设备上,点击“继续安装”,安装完即可查看到设备摄像头捕获的内容和推理结果。
如下图所示,识别出的概率最高的物体是植物。
本实验基于MindSpore Lite预置模型完成了端侧推理过程,可在Android手机中体验图像分类功能。
MindSpore实验,仅用于教学或培训目的。配合MindSpore官网使用。 MindSpore experiments, for teaching or training purposes only. Use it together with the MindSpore official website.
CSV Jupyter Notebook Text Python Markdown other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》