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
152
|
8
·
访问输入张量并直接写入它们的内存。
·
从输出张量中读取内存并将其复制到浮点数组等高级数据结构。
·
将带有故事板和视图控制器的用户界面连接起来。
8-18
:在
iPhone
模拟器中运行应用程序
在下一节中,你将超越这个简单的场景,着眼于处理更复杂的数据。
8.4.8
超越“
Hello World
:处理图像
在前面的示例中,你看到了如何创建一个完整的应用程序,该应用程序使用 TensorFlow
Lite 进行非常简单的推理。然而,尽管应用程序很简单,但将数据输入模型和解析模型
数据的过程可能有点不直观,因为你要处理底层存储。当你进入更复杂的场景(例如管
理图像)时,好消息是该过程并没有那么复杂。
考虑用你创建的模型来区分猫和狗。在本节中,你将看到如何在 Swift 中使用经过训练
的模型创建 iOS 应用程序,该模型在给定猫或狗的图像的情况下,能够推断出图片中的
内容。本书 GitHub 存储库中提供了完整的应用程序代码,以及用于训练模型并将其转
换为 TFLite 格式的 Colab notebook
首先,回想一下图像的张量具有三个维度:宽度、高度和颜色深度。因此,例如,当使
用基于狗与猫样本的 MobileNet 架构时,尺寸为 224×224×3
每张图像为 224×224
像素,并且具有三个颜色深度通道。请注意,归一化后的每个像素在每个通道中都由 0
1 之间的值表示,指示该像素在红色、绿色和蓝色通道上的强度。
正文.indd 152正文.indd 152
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