Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CoreMLで実現する爆速のARサイズ計測
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kohei Arai
September 06, 2019
Technology
2.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CoreMLで実現する爆速のARサイズ計測
9/6(金)に行われたiOSDC 2019でのLT資料です。
Kohei Arai
September 06, 2019
More Decks by Kohei Arai
See All by Kohei Arai
VisionKit_Basics.pdf
kokoheia
0
210
Swift5_Cheet_Sheet.pdf
kokoheia
7
1.4k
Other Decks in Technology
See All in Technology
React改造してみた
tsukina_7mochi
0
140
会社紹介資料 / Sansan Company Profile
sansan33
PRO
31
430k
「私が一番顧客に詳しい」を捨てる~ 全員が一次情報に精通する開発チームをつくり、PMが次のボトルネックへ染み出すまで
kaminashi
0
200
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
210
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
270
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
130
What Is JetBrains Air
x5gtrn
PRO
0
120
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
5
1.4k
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
150
その Valkey 使いこなしていますか?
onk
PRO
5
1.7k
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
460
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
830
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
630
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Git: the NoSQL Database
bkeepers
PRO
433
67k
Transcript
iOSDC 2019 CoreMLで実現する 爆速のARサイズ計測 Kohei Arai @kokoheia
Kohei Arai @kokoheia • Mercari / 新卒 iOS Engineer •
Twitter: @kokoheia • Instagram: @kokoheia • ポートレートを撮るのが趣味です • 最近PUBGにハマっています
突然ですが、みなさん こんな経験をしたことは ありませんか?
「フリマアプリで洋服を出品したい!」
特に、洋服の「サイズ」を載せたい (コメントで聞かれた。。)
そうだ、AR Measureで 測ってみよう!
。。。。
。。。結構面倒くさい • そもそも測る場所がわからない • 測り方が合ってるか自信ない • 何枚も出品したいけど時間かけたくない。。
IN THE NEXT FIVE MONTHS ARメジャーの課題 • ARの体験に慣れるのに時間がかかる • 大きいものを測るのが大変
• メジャーを代替しただけなので計測にかか る時間はあまり変わらず Item 1 Item 2 Item 3 Item 4 Item 5 40 30 20 10 0
テクノロジーを使って もっと簡単に測ることは できないか!?
ML(機械学習) ✖AR で 爆速 & 超簡単にサイズ計測する
Demo
None
仕組み 画像を撮影 ML(機械学習)で 画像内の特徴点の座標を 推定 特徴点の座標を元に AR Kitを使って現実世界 のスケールを得る。
MLモデル created by ARヒノボル / @liketableteninu 姿勢推定のモデルを応用 Alibabaのデータセット
2Dの推定 3Dの推定(AR) 仕組み
どれくらい 速くなったのか?
測定した対象 袖丈、肩幅、身幅、着丈の4点 出典: https://minne.com/items/17640623
サイズ計測にかかる時間 自力 ML + AR 40 ~ 50秒 10 ~
15秒
もっと速くしたい!
CoreMLを使って サーバレスで推定
Demo 2: CoreML
None
サイズ計測にかかる時間 自力 AR + ML (サーバー) 40 ~ 50秒 10
~ 15秒 AR + CoreML 5秒未満
MLモデルの生成 Created by ARヒノボル / @liketableteninu
推定の精度 サーバー CoreML 身幅 2cm以内 2cm以内 着丈 5cm以内 5cm以内 袖丈
10cm前後 10cm前後 肩幅 10cm前後 10cm前後 推定しやすい 推定しづらい
• モデル自体を改善する ◦ カテゴリごとの画像の数を増やして学習する • 物体認識の精度をあげる (for CoreML) ◦ 機械学習で物体認識してから、その範囲内で推定すると精度が上がる
精度を改善するために
ML ✖ AR Measureの可能性 • 人間のサイズも測定できる → 服と照らし合わせてフィット度を計測する • 靴やインテリアなど、服以外の商品にも応用が可能
ご清聴ありがとうございました!
おまけ
推定の速度 サーバー(GPU) サーバー(CPU) CoreML 2 ~ 3秒以下 6秒程度 1秒以下
月あたりコスト(一例) サーバー(GPU) サーバー(CPU) CoreML 約68,000円 / 台 約13,000円 / 台
無料 GPUはaws p2.xlarge, CPUはaws c5xlargeを参照。 GPU: 0.9(USD/hr) * 24 hrs * 30 days * 105(JPY/USD) = 68,040JPY CPU: 0.17(USD/hr) * 24 hrs * 30 days * 105(JPY/USD) = 12,852JPY
Pytorchからモデルを変換した理由 • Turi Create や Create MLでモデルを作ることも 検討した • Pythonで書かれた機械学習用のライブラリに比
べるとできる処理も限られていたためPytorchか らの変換を採用
非同期のHit Test処理
非同期のHit Test処理のTips Hit Testには3種類ある • ARSCNView hitTest(_ point: CGPoint, types:
ARHitTestResult.ResultType) -> [ARHitTestResult] • ARSKView hitTest(_ point: CGPoint, types: ARHitTestResult.ResultType) -> [ARHitTestResult] • ARFrame hitTest(_ point: CGPoint, types: ARHitTestResult.ResultType) -> [ARHitTestResult]
非同期のHit Test処理のTips • 画像をサーバに送りレスポンスが帰ってくるのを待たなくては行 けなかった • 今回は画像撮影時のARFrameを保存しておいて、レスポンスが 帰ってきてから、保存済みのARFrameからhitTest処理をするとい う実装をした •
最初、予想した結果とはるかに異なる点がプロットされて戸惑っ た
非同期のHit Test処理のTips ARFrameを使ってhitTestをするときは、結果をinvertしないといけなかった
参考 • https://www.digitaltrends.com/mobile/how-to-use-the-measure-app-in-ios-12/ • https://github.com/matterport/Mask_RCNN • https://github.com/LiMeng95/MultiPoseNet.pytorch • https://tianchi.aliyun.com/mobile/gameDetail/231670 •
https://qiita.com/kamata1729/items/e54bcb7d0ed3d296daf8 • https://aws.amazon.com/jp/emr/pricing/ • https://pytorch.org/ • https://github.com/onnx/onnx • https://github.com/onnx/onnx-coreml • https://developer.apple.com/documentation/arkit/arframe/2875718-hittest