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
450
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
870
PiPを応用した配信コメントバー機能の開発秘話と技術の詳解 / pip_streaming_comment_bar
narujpn
3
4k
Updating an App to Use Swift Concurrency 解説
narujpn
2
320
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.2k
CoreML3のオンデバイストレーニングでつくる母音推定
narujpn
0
420
AltConfと周辺の歩き方
narujpn
0
2k
エンジニア経験を活かしたスクラムマスターとして 開発チームとプロダクトを成長させる
narujpn
1
400
Other Decks in Technology
See All in Technology
AWSを利用する上で知っておきたい名前解決の話
nagisa53
6
850
4月15日の AZ 障害をテクサポの中の人目線で振り返ってみる
kazzpapa3
2
160
MagicPodが描くAIエージェント戦略とソフトウェアテストの未来
magicpod
0
270
自動化の第一歩 -インフラ環境構築の自動化について-
smt7174
1
140
AIフレンドリーなプロダクト開発を目指して 〜MCPを橋渡しにした環境移行〜
shinpr
0
110
LangfuseではじめるAIアプリのLLMトレーシング
codenote
0
190
Kaigi Effect 2025 #rubykaigi2025_after
sue445
0
170
newmo の創業を支える Software Architecture と Platform Engineering
110y
5
560
ユーザーコミュニティが海外スタートアップのDevRelを補完する瞬間
nagauta
1
200
LLMの開発と社会実装の今と未来 / AI Builders' Community (ABC) vol.2
pfn
PRO
2
180
Previewでもここまで追える! Azure AI Foundryで始めるLLMトレース
tomodo_ysys
2
740
ホワイトボックス& SONiC アーキテクチャ(全体像) - SONiC Workshop Japan 2025
ebiken
PRO
1
200
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Why Our Code Smells
bkeepers
PRO
336
57k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Site-Speed That Sticks
csswizardry
6
550
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Embracing the Ebb and Flow
colly
85
4.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
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!