使用谷歌云ml与Android应用程序 [英] Using google cloud ml with Android app

查看:143
本文介绍了使用谷歌云ml与Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究谷歌云上的这个例子ml:链接。我想知道如何将我的Android应用程序连接到此,以便我可以发送数据值,并在通过Tensorflow处理后将预测返回给我的应用程序。



我认为它必须是某种API连接,可以让我们做到这一点,但我找不到任何文档或例子。



请帮助!!

解决方案

你是对的,然后上传的模型作为API提供给你,你可以使普通的http POST请求并获得预测。这是他们的结构。



也许读一点关于批量和在线预测。看起来你在寻找在线预测 - 所以一定要为这些人提出请求,而不是提交工作。

要在应用程序中使用此内容,您还需要进行身份验证。最简单的方法就是查找 Cloud ML Java客户端库。



在您的Android应用程序中成功实施Cloud ML预测的步骤可能涉及:

- 部署一个训练有素的Cloud ML模型(我假设你有这个)

- 在Google Cloud项目中创建一个服务帐号,给它相应的Cloud ML权限并下载其密钥

- 使用在应用程序启动时获取证书(在API客户端文档之后)的应用程序中的此密钥

- 进行在线预测请求



没有看到任何超级简单的例子就可以做到这一点,但目前来看,它们肯定会在某些时候出现。现在你最好的选择可能是通过文档。

I am studying this example on google cloud ml : link. I want to know how I can connect my Android app to this so that I can send in a data value and receive the prediction back to my app after processing it through Tensorflow.

I am thinking it has to be some sort of API connection that allows us to do this but I just can't find any documentation or examples that do this.

Please help!!

解决方案

You're right, the uploaded model is then provided to you as an API and you can make normal http POST requests and obtain predictions. This is their structure.

Perhaps read a little bit about the difference between batch and online predictions. It seem you are looking for online predictions - so make sure to make requests for those, not to submit jobs.

To use this inside of an application you also need to authenticate. The easiest way to do all that is to look for the documentation of the Cloud ML Java client library.

The steps to successfully implement Cloud ML predictions in your Android app might involve:
- deploy a trained model to Cloud ML (I assume you have this)
- create a service account in the Google Cloud project, give it appropriate Cloud ML rights and download its key
- use this key from within the application to get credentials (following the API Client docs) when the application starts
- make online prediction requests

I haven't seen any super easy to follow examples on doing this end to end just yet but surely they will come at some point. Right now your best bet is probably to go through the documentation.

这篇关于使用谷歌云ml与Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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