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
iOS
上使用
ML Kit
的计算机视觉应用程序
|
101
let options = ObjectDetectorOptions()
options.detectorMode = .singleImage
options.shouldEnableClassification = true
options.shouldEnableMultipleObjects = true
let objectDetector = ObjectDetector.objectDetector(
options: options)
浏览选项类型的 ML Kit 文档,我在这里使用的都是非常常用的。
EnableClassification
不仅为你提供边界框,还提供 ML Kit 对物体的分类。基本模型(你在此处使用的)仅识
5 种非常通用的物体类型,例如“时尚商品”或“食品”,因此请合理地管理你的期
望!
EnableMultipleObjects
选项在设置后,将允许你检测多个物体,如图 6-6 所示,
其中检测了三个物体(一只鸟和两朵花)并绘制了边界框。
最后,你把图像传递给物体检测器,让它推断出它在图像中发现的物体的标签和边界
框。这是一个异步函数,因此你需要指定在推理完成时回调的函数。 ML Kit 将返回一
detectedObjects
列表和一个错误对象,因此你可以简单地将它们传递给你接下来要
创建的函数:
objectDetector.process(visionImage)
{ detectedObjects, ...
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

快速提升人工智能产品的实用指南

快速提升人工智能产品的实用指南

Hamel Husain
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
AI原生软件交付

AI原生软件交付

Nick Durkin, Eric Minick, Chinmay Gaikwad

Publisher Resources

ISBN: 9787111713081