将ML Kit与NNAPI一起使用 [英] Use ML Kit with NNAPI

查看:100
本文介绍了将ML Kit与NNAPI一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在运行Android 9的Android设备上使用新的Google机器学习sdk ML Kit.在官方网站上:

I'm trying to use the new Google machine learning sdk, ML Kit, on an Android devices that run Android 9. From the official site:

通过

ML Kit,您可以轻松地将ML技术应用到您的应用中Google的ML技术,例如Google Cloud Vision API,TensorFlow Lite和Android Neural Networks API一起在一个单个SDK.无论您需要基于云的处理功能,针对移动设备进行优化的设备模型的实时功能,或者自定义TensorFlow Lite模型的灵活性,ML Kit使之成为可能只需几行代码.

ML Kit makes it easy to apply ML techniques in your apps by bringing Google's ML technologies, such as the Google Cloud Vision API, TensorFlow Lite, and the Android Neural Networks API together in a single SDK. Whether you need the power of cloud-based processing, the real-time capabilities of mobile-optimized on-device models, or the flexibility of custom TensorFlow Lite models, ML Kit makes it possible with just a few lines of code.

我认为这意味着在至少具有Android 8.1(根据nnapi的文档)的设备上,SDK可以使用NNAPI.但是,当我在装有Android 7.1(不支持nnapi)的设备上运行相同的应用程序时,可以获得与使用Android 9(理论上为NNAPI)的设备相同的性能.我如何将ML Kit与NNAPI一起使用?我做错了吗?链接到mlkit的文档: https://firebase.google.com/docs/ml-kit/

I think it means that on a device with at least Android 8.1 (according to the documentation of nnapi) the SDK can uses NNAPI. But when I run the same app on a device with Android 7.1 (where nnapi is not supported) I obtain the same performance of the device that use Android 9 (and in theory the NNAPI). How i can use ML Kit with NNAPI? I am doing something wrong? Link to documentation of mlkit: https://firebase.google.com/docs/ml-kit/

推荐答案

根据2018年10月的这篇论文:AI基准测试:运行深度神经网络在Android智能手机上,当没有特定的硬件和/或驱动程序不可用时,NNAPI默认为CPU路径.在本文结尾处,它指出许多设备都有实现问题.

According to this Oct 2018 paper: AI Benchmark: Running Deep Neural Networks on Android Smartphones, the NNAPI is defaults to the CPU path when no specific hardware and/or no drivers are available. Toward the end of the paper it notes that a number of devices have implementation issues.

由于本文的作者包括高通,ARM,华为,联发科和苏黎世联邦理工学院的代表,这可能是关于Android机器学习状态的最全面概述.

As the paper's authors include representatives from Qualcomm, ARM, Huawei, MediaTek, and ETH Zurich, it is probably the most comprehensive overview of the state of machine learning on Android.

2019年1月,Google宣布

In Jan 2019 Google announced TensorFlow Lite with GPU acceleration in developer preview which will address some of the issues raised in the paper.

2020年7月更新:

研究人员在以下站点拥有一个网站: http://ai-benchmark.com/

The researchers have a site at: http://ai-benchmark.com/

并于2019年10月更新了论文: AI基准测试:2019年关于智能手机深度学习的一切

And have updated their paper in Oct 2019: AI Benchmark: All About Deep Learning on Smartphones in 2019

这篇关于将ML Kit与NNAPI一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆