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
181
10
Android 中使用自定义模型
在第 9 章中,你了解了使用 TensorFlow Lite Model MakerCloud AutoML Vision Edge
以及具有迁移学习功能的 TensorFlow 来创建自定义模型的各种场景。在本章中,你将探
索如何使用这些并将其集成到你的 Android 应用程序中。不幸的是,它很少像“将模型
放入应用程序就直接能工作”那么简单。处理数据通常会很复杂,因为 Android 会以不
同于 TensorFlow 的方式来表示图像和字符串等内容,而且实际上,模型的输出需要从基
Tensor 的输出解析为在 Android 中更具表现性的内容。 我们将首先探讨这一点,然后
进入一些关于如何在 Android 中使用图像和语言模型的示例。
10.1
将模型桥接到
Android
在创建使用机器学习模型的应用程序时,你会拥有一个扩展名为
.tflite
的二进制区块,
你将把它合并到你的应用程序中。这个二进制文件希望有张量输入(或它们的一些模拟
输入),并会输出张量。那将是第一个挑战。此外,该模型只有在有相关联的元数据时才
能很好地工作。因此,举例来说,如果你构建一个花卉分类器,如第 9 章中所述,该模
型会为你提供 5 个概率的输出,每个概率匹配特定的花卉类型。然而,该模型并没有输
出花的类型,例如玫瑰。它只是为你提供一组数字,因此你需要关联的元数据才能知道
哪个输出值与哪朵花匹配。此外,如果你使用语言模型进行文本分类,你还需要了解模
型训练所使用的单词词典。我们将在本章中探讨这一点! ...
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