Skip to Content
移动端AI与ML应用开发:基于iOS和Android
book

移动端AI与ML应用开发:基于iOS和Android

by Laurence Moroney
January 2023
Intermediate to advanced
288 pages
6h 6m
Chinese
China Machine Press
Content preview from 移动端AI与ML应用开发:基于iOS和Android
Android
中使用自定义模型
|
187
10.3
Model Maker
输出与
ML Kit
结合使用
在第 4 章中,你看到了如何使用 ML Kit 的图像标记 API 作为计算机视觉的简单解决方
案。它为你提供了一个通用的图像分类器,因此如果你向它展示一朵花的图片,它会为
你提供有关该图像的一些详细信息。具体情况如图 10-5 所示。
10-5
:运行通用图像分类器
如你所见,这告诉我们,我们正在观察花瓣、花朵、植物和天空!虽然一切都是准确
的,但如果我们为刚创建的自定义模型提供一个即插即用的解决方案,它可以识别特定
的花朵并将其标记为雏菊,那就太好了!
值得庆幸的是,这并不难,我们只需几行代码就可以更新该应用程序。你可以从本书的
GitHub 页面获取它。
首先,你需要添加 ML Kit 自定义标记 API。因此,除了通过 build.gradle 添加的图像标
记库之外,只需添加图像标记自定义库:
// You should have this already
implementation 'com.google.mlkit:image-labeling:17.0.1'
// Just add this
implementation 'com.google.mlkit:image-labeling-custom:16.3.1'
你的应用程序有一个 assets 目录,其中添加了你在第 4 章使用的一些示例图像。添加你
使用 TensorFlow Lite Model Maker 创建的
model.tflite ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能驱动的商业智能

人工智能驱动的商业智能

Tobias Zwingmann
Lua游戏AI开发指南

Lua游戏AI开发指南

Posts & Telecom Press, David Young
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar

Publisher Resources

ISBN: 9787111713081