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
Make faces big by Vision and CoreGraphics
Search
naru-jpn
March 02, 2018
Technology
0
440
Make faces big by Vision and CoreGraphics
“Can you make faces big?”
naru-jpn
March 02, 2018
Tweet
Share
More Decks by naru-jpn
See All by naru-jpn
配信アプリのためのリアルタイムプッシュ通知ぼかしの夢
narujpn
3
840
PiPを応用した配信コメントバー機能の開発秘話と技術の詳解 / pip_streaming_comment_bar
narujpn
3
3.9k
Updating an App to Use Swift Concurrency 解説
narujpn
2
300
PiP で実現するミラティブの配信コメントバー / pip-streaming-comment-bar
narujpn
0
1.1k
App Extension のスタックトレース情報からクラッシュを解析/集計する / Analyzing app extension's stack trace
narujpn
3
1.4k
ミラティブとWebRTC - WebRTC framework の中身を覗いてみよう / WebRTC framework AudioUnit Processing
narujpn
1
2.1k
CoreML3のオンデバイストレーニングでつくる母音推定
narujpn
0
410
AltConfと周辺の歩き方
narujpn
0
1.9k
エンジニア経験を活かしたスクラムマスターとして 開発チームとプロダクトを成長させる
narujpn
1
390
Other Decks in Technology
See All in Technology
あなたが人生で成功するための5つの普遍的法則 #jawsug #jawsdays2025 / 20250301 HEROZ
yoshidashingo
2
330
Two Blades, One Journey: Engineering While Managing
ohbarye
4
2.5k
AWS Well-Architected Frameworkで学ぶAmazon ECSのセキュリティ対策
umekou
2
150
【内製開発Summit 2025】イオンスマートテクノロジーの内製化組織の作り方/In-house-development-summit-AST
aeonpeople
2
1.1k
DevinでAI AWSエンジニア製造計画 序章 〜CDKを添えて〜/devin-load-to-aws-engineer
tomoki10
0
210
20250304_赤煉瓦倉庫_DeepSeek_Deep_Dive
hiouchiy
2
120
2/18 Making Security Scale: メルカリが考えるセキュリティ戦略 - Coincheck x LayerX x Mercari
jsonf
0
250
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
2
160
EMConf JP 2025 懇親会LT / EMConf JP 2025 social gathering
sugamasao
2
210
[OpsJAWS Meetup33 AIOps] Amazon Bedrockガードレールで守る安全なAI運用
akiratameto
1
130
事業モメンタムを生み出すプロダクト開発
macchiitaka
0
100
EDRの検知の仕組みと検知回避について
chayakonanaika
12
5.3k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
Speed Design
sergeychernyshev
27
810
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
Making Projects Easy
brettharned
116
6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
13
1k
Gamification - CAS2011
davidbonilla
80
5.2k
Designing for Performance
lara
605
68k
Optimizing for Happiness
mojombo
377
70k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Automating Front-end Workflow
addyosmani
1369
200k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Transcript
Make faces big by Vision and CoreGraphics VisionͱCoreGraphicsͰإΛσΧ͘͢Δ Naruki Chigira,
Timers inc. @naruchigi Try! Swift 2018
“Can you make faces big?”
“In about a week.”
None
Core Image want actual
Core ML too much learning cost (also for me) …
Vision
Vision ɾFace Detection and Recognition ɾBarcode Detection ɾText Detection ɾHorizon
Detection ɾObject Detection and Tracking
VNFaceLandmarkRegion2D Class 2D geometry information for a specific facial feature.
VNFaceObservation Class Face or facial-feature information detected by an image analysis request.
Face Couture [CGPoint]
// 1. Create VNDetectFaceLandmarksRequest let request = VNDetectFaceLandmarksRequest() { (request,
error) in guard let results = request.results else { return } let faceObservations = results.flatMap({ $0 as? VNFaceObservation }) // 3. Handle results // … } // 2. Create VNImageRequestHandler and perform let handler = VNImageRequestHandler(cgImage: cgImage, options: [:]) try! handler.perform([request]) How to get VNFaceLandmarkRegion2D
Face Couture
None
None
None
None
None
Core Graphics
CGPoint Structure A structure that contains a point in a
two-dimensional coordinate system.
CGAffineTransform Structure An affine transformation matrix for use in drawing
2D graphics.
CGPoint Structure Instance Method func applying(_ t: CGAffineTransform) -> CGPoint
O
O 1. translate
O 1. translate 2. rotate
O 1. translate 2. rotate 3. reverse + joint
O 1. translate 2. rotate 3. reverse + joint 4.
rotate-1
O 1. translate 2. rotate 3. reverse + joint 4.
rotate-1 5. translate-1
O A A-1 } } 1. translate 2. rotate 3.
reverse + joint 4. rotate-1 5. translate-1
Modify [CGPoint] in Swift // 1. Create CGAffineTransform A let
A = CGAffineTransform(rotationAngle: -theta).translatedBy(x: x, y: y) // 2. Apply A let transformed = points.map { $0.applying(A) } // 3. Reverse & Joint let oval = transformed + transformed.map { CGPoint(x: -$0.x, y: -$0.y) } // 4. Apply A-1 let result = oval.map { $0.applying(A.inverted()) }
Result
None
None
Summary Get facial features from Vision (iOS 11.0~) Process data
using CoreGraphics (iOS 2.0~) +
Thank you!