Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What's new in Vision
Search
Sato Takeshi
June 24, 2022
Technology
0
2.3k
What's new in Vision
集まれSwift好き!Swift愛好会スピンオフ WWDC22セッション要約会 @オンライン
https://love-swift.connpass.com/event/247317/
の資料
Sato Takeshi
June 24, 2022
Tweet
Share
More Decks by Sato Takeshi
See All by Sato Takeshi
まさかのバグ!SwiftUIプレビューでハマった国際化対応の落とし穴
satotakeshi
0
390
Swift愛好会 の 思い出
satotakeshi
0
130
Xcode 15, Swift 5.9で変わる開発体験
satotakeshi
3
3.1k
Meet passkeys
satotakeshi
2
410
Swift Concurrency入門
satotakeshi
11
5.5k
複数端末のつらさを乗り越えてiOS UITestを実行
satotakeshi
1
470
Xcodegenを個人アプリに導入
satotakeshi
3
900
SwiftUIで作る開閉式メニュー
satotakeshi
2
3.2k
swift-snapshot-testingでVisual Testingを効率化
satotakeshi
0
1.5k
Other Decks in Technology
See All in Technology
Astro Islandsの 内部実装を 「日本で一番わかりやすく」 ざっくり解説!
knj
0
230
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
310
TypeScript 7.0の現在地と備え方
uhyo
7
2k
めちゃくちゃ開発するQAエンジニアになって感じたメリットとこれからの課題感
ryuhei0000yamamoto
0
270
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
270
Phase06_ClaudeCode実践
overflowinc
0
1.7k
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
0
140
脳が溶けた話 / Melted Brain
keisuke69
1
820
DDD×仕様駆動で回す高品質開発のプロセス設計
littlehands
5
2.2k
Phase04_ターミナル基礎
overflowinc
0
2k
Phase01_AI座学_基礎
overflowinc
0
3.4k
Tebiki Engineering Team Deck
tebiki
0
27k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
770
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
300
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
210
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
76
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Accessibility Awareness
sabderemane
0
84
Transcript
What’s new in Vision 2022 年 6 月 24 日
集まれ Swift 好き! Swift 愛好会スピンオフ WWDC22 セッション要約会 @ オンライン
Who am I • Name • 佐藤タケシ ( さとうたけし )
• Company • Merpay, Inc.(2019/01 ~) • Role • Software Engineer (iOS) • Account • Twitter: @hatakenokakashi • Facebook: 佐藤剛士 • GitHub: SatoTakeshiX
近著 商業誌 Amazon で販売中 同人誌 BOOTH で 販売中 商業誌 Amazon
で販売中
Vision/VisionKit Frameworkの新機能
VisionとVisionKitの違い Vision Framework • 画像分析ができる Framework • 画像データを渡し、画像を分析する • 分析する種類によってクラスが分か
れている • https://developer.apple.com/jp/mac hine-learning/api/ VisionKit Framework • Live Text • カメラを通してテキスト分析 • ドキュメントスキャン ◦ VNDocumentCameraViewCo ntroller ◦ iOS 13 ◦ Note アプリのようにドキュメント スキャンする
Vision VisionKit
Visionの新機能 • テキスト認識の言語に日本語と韓国語が追加! • テキスト認識・バーコード検出・オプティカルフロー検出の精度が向上 • 顔検出の Revision 1 のコード、モデルを削除
• Quick Look Preview のサポート
https://developer.apple.com/videos/play/wwdc2022/10024/
https://developer.apple.com/videos/play/wwdc2022/10024/
テキスト認識の言語に日本語と韓国語が追加! • iOS 16 で使える言語 ◦ 英語、フランス語、イタリア語、ドイツ語、スペイン語、ポルトガル語、中国語(繁 体字、簡体字)、日本語、韓国語が利用できる • VNRecognizeTextRequest
の supportedRecognitionLanguages メソッドで言語が 取得できる
顔検出のRevision 1のコード、モデルを削除 • Vision はアルゴリズムのバージョンを Revision で指定できる • 顔の特徴点を検出する VNDetectFaceRectanglesRequest
◦ VNDetectFaceLandmarksRequestRevision1 が非推奨 • 顔の矩形を検出する VNDetectFaceLandmarksRequest ◦ VNDetectFaceRectanglesRequestRevision1 が非推奨 • Revision1 を指定している場合 Revision2 として扱われる
Revision 1を指定してRevision 2になる影響 • Revision 1 の挙動は変わらない ◦ いきなり上下ひっくり返った顔結果が来ることはない •
実行時間は変わらず • 正確さが向上 • コードの修正は不要
Quick Look Previewのサポート • デバッカーに Vision の検出結果が表示されるようになった • 分析対象の画像に検出結果を表示 •
Xcode Playground でも結果を表示
VisionKitの新機能
VisionKitの新機能 • DataScannerViewController が iOS 16 で登場 • カメラ画像からテキストやバーコード、 QR
コードを読み取る
今までのカメラ映像からテキスト読み取り
DataScannerViewController
DataScannerViewControllerの機能 • ライブカメラプレビュー • 案内 • 項目のハイライト
DataScannerViewControllerの機能 • タップで焦点合わせ • ピンチアウト、ズームイン
DataScannerViewControllerの使い方 • 端末が利用できるかのチェック ◦ isSupported ▪ A12 Bionic chip 以上の端末なら
true ▪ 2018 年以降の端末 ◦ isAvailable ▪ 設定アプリでカメラ利用がオンになっていれば true ▪ またカメラ利用の制限がない場合
DataScannerViewControllerの使い方 • info.plist に Privacy usage description を追加 ◦ カメラ実装するときと同じ
DataScannerViewControllerの初期化
DataScannerViewController.RecognizedDataType • スキャンするデータのタイプ • 読み取れるコード一覧 ◦ / Aztec / Codebar
/ Code 39 Checksum /Code 39 / Code 39 Full ASCII /Code 39 Full ASCII Checksum /Code 93 / Code 93i / Code 128 / Matrix EAN-8 / Data /EAN-13 / GS1 DataBar Expanded / GS1 DataBar Limited / ITF/ ITF-14 / MicroPDF417 / MicroQR / PDF417 QR / UPC-E • サポート言語 ◦ English, French, Italian, German Spanish, Portuguese, Chinese, Japanese, Korian • テキストの種類 ◦ Full Street Address / Telephone Number / mail Address / URL / Shipment Tracking Number / Flight Number / Date, Time, and Duration
None
DataScannerViewControllerDelegate アイテムをタップしたら呼ばれる
DataScannerViewControllerDelegate アイテムが追加されたら呼ばれる
DataScannerViewController 画像を取得
DataScannerViewController for await in でデリゲートなしで結果取得
Live Text
Live Text • 静止画像も開発者がテキ ストを読み込める実装で きるようになる https://developer.apple.com/d ocumentation/visionkit/enabl ing_live_text_interactions_wi th_images
広がるアイディア 日本語テキスト認識 • 家計簿アプリでレシート読み込み • メモアプリで印刷物の読み込み • ハッシュタグキャンペーン ◦ SNS
に投稿された住所にいってドーナツを配るキャンペーン QR コード読み込み • 配送センターアプリ • ライブイベントの会場受付アプリ
まとめ
まとめ • Vision がアップデート ◦ テキスト認識に日本と韓国が追加 ◦ バーコード検出・オプティカルフロー検出の精度が向上 ◦ 顔検出の
Revision 1 のコード、モデルを削除 ◦ Quick Look Preview のサポート • DataScannerViewController でビデオ画像によるテキストスキャンが簡単に 実装可能になる • Live Text で静止画もテキストスキャンの実装簡単になる
参考資料 • Add Live Text interaction to your app •
What's new in Vision • Capture machine-readable codes and text with VisionKit • Scanning data with the camera