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
Detect Body and Hand Pose with Vision
Search
Koki Hirokawa
July 01, 2020
Technology
970
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Detect Body and Hand Pose with Vision
Koki Hirokawa
July 01, 2020
More Decks by Koki Hirokawa
See All by Koki Hirokawa
KMP の Swift export
kokihirokawa
0
780
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
410
App内課金におけるトラブルを劇的に減らすための取り組み
kokihirokawa
2
1.3k
ABEMAのリアーキテクチャ
kokihirokawa
5
5.5k
Other Decks in Technology
See All in Technology
知らん間に、回ってる
ming_ayami
0
540
Claude Code 珍プレー好プレー
shinyasaita
0
330
Terraform共通モジュールをチーム横断で“変えられる”運用へ ― リリースと適用の分離
kekke_n
1
2.9k
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
480
Kaggleで成長するために意識したこと
prgckwb
2
320
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
170
Foxgloveについて 実際にExtensionを開発して公開するまでの話 / About Foxglove: The Story of Developing and Releasing an Extension
ry0_ka
0
210
AI時代の EM への処方箋
staka121
PRO
0
140
完全自律ロボットを作りたくて、先に開発を自律させた話(ROS Japan UG #63 LT)
rryz09
0
510
Road to SRE NEXTの今までとこれから
hiroyaonoe
0
310
「ちゃんとやっている」は独りよがりだった ― 不安に寄り添うインシデント対応へ / Towards incident response that addresses anxieties
chmikata
1
5.1k
人を動かすのは時間ではなく、納得感 〜新任EMが入社3ヶ月、組織を2回変えた話〜
kakehashi
PRO
3
220
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Docker and Python
trallard
47
3.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Product Roadmaps are Hard
iamctodd
55
12k
Chasing Engaging Ingredients in Design
codingconduct
0
230
How to build a perfect <img>
jonoalderson
1
5.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
A better future with KSS
kneath
240
18k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
Transcript
Koki Hirokawa Detect Body and Hand Pose With Vision CA.swift
#12
ኍ߉ل / Koki Hirokawa / ͽʔͻΖ GitHub -> KokiHirokawa Twitter
-> @pihero13
ਓؒͷࢹ֮γεςϜʹ͓͍ͯߦ͑ΔλεΫΛίϯϐϡʔλͰ࣮ݱ͢Δ͜ͱΛٻ͢Δݚڀ Computer Vision ͱʁ
iOS 11 Ͱಋೖ͞ΕͨϑϨʔϜϫʔΫ إͷϥϯυϚʔΫݕग़ɾςΩετݕग़ɾόʔίʔυೝࣝɾը૾ೝࣝ ྨମݕग़ʹಠࣗͷ Core ML ϞσϧΛ༻͢Δ͜ͱՄೳ iOS /
Vision ͱʁ
ମͱखͷϙʔζΛݕͰ͖ΔΑ͏ʹͳͬͨ Detect Body and Hand Pose with Vision
͏ࣗࡱΓ͍Βͳ͍ ಛఆͷδΣενϟʔΛݕͯ͠γϟολʔΛΔ ׆༻ྫᶃ
δΣενϟʔͷྨ ֆจࣈΛΦʔόʔϨΠ ׆༻ྫᶄ
࣮ࡍͲͷ͘Β͍ͷύϑΥʔϚϯε͕ ग़ͤΔͷʁ
ͪ͜ΒαϯϓϧΞϓϦͱͯ͠͞Ε͍ͯ·͢ ۭதͰจࣈΛॻ͚ΔΞϓϦͰݕূ
ྲྀੴʹֆݫ͍͠Μ͡Όͳ͍ʁ
ԿΛඳ͍͍ͯΔ͔νϟοτͰͯͯΈͯԼ͍͞
ࢥͬͨΑΓઢ͕៉ྷʹॻ͚Δʂ ࢦΛ͍Α͘ಈ͔ͯ͠ݕͯ͘͠ΕΔʂ Beta ൛͚ͩͲɺ҆ఆ͍ͯ͠Δɻ ͨͩɺશͯͷࢦ͕ݟ͑ΔΑ͏ʹ͠ͳ͍ͱ্ख͘ݕͯ͘͠Εͳ͍ɻ ମݧͯ͠Έͨॴײ
ը໘ͷͰ্ख͘ػೳ͠ͳ͍͜ͱ͕͋Δ Χϝϥͷࢹํʹରͯ͠ฒߦͳखݕ͕͍͠ खାΛ͍ͯ͠Δ߹ݕ͕͍͠ Λखͱצҧ͍ͯ͠͠·͏͜ͱ͕͋Δ σόΠεݻఆ͞ΕΔඞཁ͕͋Δ ਫ਼ΛߴΊΔͨΊͷߟྀࣄ߲
࣮໘ͷʹҠΓ·͢
Request ͷ࡞ Handler ͷ࡞ & Handler ʹ Request Λ͢ ݁Ռͱͯ͠
Observation Λऔಘ͢Δ λεΫͷྲྀΕ
var handPoseRequest = VNDetectHumanHandPoseRequest() let handler = VNImageRequestHandler( cmSampleBuffer: sampleBuffer,
orientation: .up, options: [:] ) try! handler.perform([handPoseRequest]) let observation = handPoseRequest.results?.first as! VNRecognizedPointsObservation
var handPoseRequest = VNDetectHumanHandPoseRequest() let handler = VNImageRequestHandler( cmSampleBuffer: sampleBuffer,
orientation: .up, options: [:] ) try! handler.perform([handPoseRequest]) let observation = handPoseRequest.results?.first as! VNRecognizedPointsObservation
var handPoseRequest = VNDetectHumanHandPoseRequest() let handler = VNImageRequestHandler( cmSampleBuffer: sampleBuffer,
orientation: .up, options: [:] ) try! handler.perform([handPoseRequest]) let observation = handPoseRequest.results?.first as! VNRecognizedPointsObservation
var handPoseRequest = VNDetectHumanHandPoseRequest() let handler = VNImageRequestHandler( cmSampleBuffer: sampleBuffer,
orientation: .up, options: [:] ) try! handler.perform([handPoseRequest]) let observation = handPoseRequest.results?.first as! VNRecognizedPointsObservation
public func captureOutput( _ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from
connection: AVCaptureConnection ) { var handPoseRequest = VNDetectHumanHandPoseRequest() let handler = VNImageRequestHandler(cmSampleBuffer: sampleBuffer, …) try handler.perform([handPoseRequest]) let observation = handPoseRequest.results?.first as! VNRecognizedPointsObservation } AVCaptureVideoDataOutputSampleBufferDelegate AVCaptureSession AVCaptureVideoDataOutput
֤ϥϯυϚʔΫͷऔಘ - VNRecognizedPointGroupKey Thumb Index Finger Middle Finger Ring Finger
Little Finger
֤ϥϯυϚʔΫͷऔಘ - VNRecognizedPoint
VNRecognizedPoint • ࠲ඪͷ৴པ • x ࠲ඪ • y ࠲ඪ •
ϥϕϧ
let thumbPoints = try observation.recognizedPoints(forGroupKey: .handLandmarkRegionKeyThumb) let thumbTipPoints = thumbPoints[.handLandmarkKeyThumbTIP]!
let x = thumbTipPoints.location.x let y = thumbTipPoints.location.y
let thumbPoints = try observation.recognizedPoints(forGroupKey: .handLandmarkRegionKeyThumb) let thumbTipPoints = thumbPoints[.handLandmarkKeyThumbTIP]!
let x = thumbTipPoints.location.x let y = thumbTipPoints.location.y
let thumbPoints = try observation.recognizedPoints(forGroupKey: .handLandmarkRegionKeyThumb) let thumbTipPoints = thumbPoints[.handLandmarkKeyThumbTIP]!
let x = thumbTipPoints.location.x let y = thumbTipPoints.location.y
None
VNDetectHumanHandPoseRequest ͷ maximumHandCount Λௐ͢Δ͜ͱͰෳͷख Λݕ͢Δ͜ͱ͕Մೳ σϑΥϧτ 2 ύϥϝʔλͷΛେ͖͘͢Εͦͷ͚ͩϨΠςϯγʹӨڹ͕ੜ͡Δ ͘ઃఆ͢ΕɺͦͷҎ্ͷखݕग़͞Εͳ͘ͳΓύϑΥʔϚϯε্͕Δ ϨΠςϯγʹؔ͢Δҙࣄ߲
BODY POSE ΄΅ಉ͡ॲཧʹͳΓ·͢
ARKit ͷϞʔγϣϯΩϟϓνϟʔͱͷҧ͍
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
ग़య ʮDetect Body and Hand Pose with Visionʯ ؔ࿈ηογϣϯ ʮCreate
ML Λ༻ͨ͠ΞΫγϣϯྨࢠͷ࡞ʯ ʮComputer Vision API ͷ୳ٻʯ