Home

Awesome

SemanticSegmentation-CoreML

platform-ios swift-version lisence

This project is Object Segmentation on iOS with Core ML.<br>If you are interested in iOS + Machine Learning, visit here you can see various DEMOs.<br>

DeepLabV3-DEMO1FaceParsing-DEMODeepLabV3-DEMO-2DeepLabV3-DEMO-3
<img src="https://user-images.githubusercontent.com/37643248/99242802-167ad280-2843-11eb-959a-5fe3b169d8f0.gif" width=240px><img src="https://user-images.githubusercontent.com/37643248/110972921-e8943d80-839f-11eb-9559-2a32d3b56de0.gif" width=240px><img src="resource/IMG_3633.PNG" width=240px><img src="resource/IMG_3635.PNG" width=240px>

How it works

When use Metal

image

Requirements

Models

Download

Download model from apple's model page.

Matadata

NameInputOutputSizeiOS version+Download
DeepLabV3Image (Color 513 × 513)MultiArray (Int32 513 × 513)8.6 MBiOS 12.0+link
DeepLabV3FP16Image (Color 513 × 513)MultiArray (Int32 513 × 513)4.3 MBiOS 12.0+link
DeepLabV3Int8LUTImage (Color 513 × 513)MultiArray (Int32 513 × 513)2.3 MBiOS 12.0+link
FaceParsingImage (Color 512 × 512)MultiArray (Int32) 512 × 51252.7 MBiOS 14.0+link

Inference Time − DeepLabV3

DeviceInference TimeTotal Time (GPU)Total Time (CPU)
iPhone 12 Pro29 ms29 ms240 ms
iPhone 12 Pro Max
iPhone 1230 ms31 ms253 ms
iPhone 12 Mini29 ms30 ms226 ms
iPhone 11 Pro39 ms40 ms290 ms
iPhone 11 Pro Max35 ms36 ms280 ms
iPhone 11
iPhone SE (2nd)
iPhone XS Max
iPhone XS54 ms55 ms327 ms
iPhone XR133 ms402 ms
iPhone X137 ms143 ms376 ms
iPhone 8+140 ms146 ms420 ms
iPhone 8189 ms529 ms
iPhone 7+240 ms667 ms
iPhone 7192 ms208 ms528 ms
iPhone 6S +309 ms1015 ms

⏲: need to measure

Inference Time − FaceParsing

DeviceInference TimeTotal Time (GPU)Total Time (CPU)
iPhone 12 Pro
iPhone 11 Pro37 ms37 ms

Labels − DeepLabV3

# total 21
["background", "aeroplane", "bicycle", "bird", "boat", 
"bottle", "bus", "car", "cat", "chair", 
"cow", "diningtable", "dog", "horse", "motorbike", 
"person", "pottedplant", "sheep", "sofa", "train", 
"tv"]

Labels − FaceParsing

# total 19
["background", "skin", "l_brow", "r_brow", "l_eye", 
"r_eye", "eye_g", "l_ear", "r_ear", "ear_r", 
"nose", "mouth", "u_lip", "l_lip", "neck", 
"neck_l", "cloth", "hair", "hat"]

See also