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
上使用
ML Kit
的计算机视觉应用程序
|
65
另一个常见选项是启用分类。由于默认的物体检测器只能检测 5 类物体,并且给了它们
一个非常通用的标签,因此我这里没有打开它,我们将使用本章前面讨论过的图像标记
API 来标记我们自己的图像。如果你想检测超过 5 个基本类的物体,则可以使用自定义
TensorFlow 模型来实现。我们将在第 9 11 章中探讨使用自定义模型。
4.2.5
5
步:处理按钮交互
当用户触摸按钮时,你需要调用物体检测器,获取其响应,然后从那里得到图像中物体
的边界框。稍后我们还会使用这些边界框将图像裁剪为边界框定义的子图像,以便我们
可以将其传递给标记器。但是现在,我们只实现物体检测处理程序。它应该是这样的:
btn.setOnClickListener {
val objectDetector = ObjectDetection.getClient(options)
var image = InputImage.fromBitmap(bitmap!!, 0)
objectDetector.process(image)
.addOnSuccessListener { detectedObjects ->
// Task completed successfully
}
.addOnFailureListener { e ->
// Task failed with an exception
// ...
}
}
因此,与你之前对图像标记所做的类似 ...
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