Home

Awesome

<p align="center"> <img src="Resource/awesome-ml-demos-with-ios-logo.png" width="187" height="174"/> </p>

Awesome Hits PRs Welcome GIF PRs More Welcome

This repo was moved from @motlabs group. Thanks for @jwkanggist who is a leader of motlabs community.

Awesome Machine Learning DEMOs with iOS

We tackle the challenge of using machine learning models on iOS via Core ML and ML Kit (TensorFlow Lite).

한국어 README

Contents

Machine Learning Framework for iOS

Flow of Model When Using Core ML

Flow of Model When Using Core ML

The overall flow is very similar for most ML frameworks. Each framework has its own compatible model format. We need to take the model created in TensorFlow and convert it into the appropriate format, for each mobile ML framework.

Once the compatible model is prepared, you can run the inference using the ML framework. Note that you must perform pre/postprocessing manually.

If you want more explanation, check this slide(Korean).

Flow of Model When Using Create ML

playground-createml-validation-001

Baseline Projects

DONE

TODO

Image Classification

NameDEMONote
ImageClassification-CoreML<p align="center"><img src="Resource/MobileNet-CoreML-DEMO.gif" width="200"/></p>-
MobileNet-MLKit<p align="center"><img src="Resource/MobileNet-MLKit-DEMO.gif" width="200"/></p>-

Object Detection & Recognition

NameDEMONote
ObjectDetection-CoreML<p align="center"><img src="Resource/SSDMobileNetV2-DEMO.gif" width="200"/></p>-
TextDetection-CoreML<p align="center"><img src="Resource/TextDetection-CoreML_DEMO001.gif" width="200"/></p>-
TextRecognition-MLKit<p align="center"><img src="Resource/TextRecognition-MLKit_DEMO002.gif" width="200"/></p>-
FaceDetection-MLKit<p align="center"><img src="Resource/FaceDetection-MLKit-DEMO.gif" width="200"/></p>-

Pose Estimation

NameDEMONote
PoseEstimation-CoreML<p align="center"><img src="Resource/180801-poseestimation-demo.gif" width="200"/></p>-
PoseEstimation-TFLiteSwift<img src="https://user-images.githubusercontent.com/37643248/77227994-99ba2a80-6bc7-11ea-9b08-9bb57723bc42.gif" width=200px><img src="https://user-images.githubusercontent.com/37643248/110994933-e68ca780-83bc-11eb-8331-d827e19d2d36.gif" width=200px>-
PoseEstimation-MLKit<p align="center"><img src="Resource/PoseEstimation-MLKit-hourglass.gif" width="200"/></p>-
FingertipEstimation-CoreML<p align="center"><img src="Resource/fingertip_estimation_demo003.gif" width="200"/></p>-

Depth Prediction

DepthPrediction-CoreML<p align="center"><img src="Resource/190727-depthprediction-demo001.gif" width="200"/></p>-

Semantic Segmentation

NameDEMONote
SemanticSegmentation-CoreML<p align="center"><img src="https://user-images.githubusercontent.com/37643248/99242802-167ad280-2843-11eb-959a-5fe3b169d8f0.gif" width="200"/><img src="https://user-images.githubusercontent.com/37643248/110972921-e8943d80-839f-11eb-9559-2a32d3b56de0.gif" width=200px></p>-

Application Projects

NameDEMONote
dont-be-turtle-ios<p align="center"><img src="Resource/dont-be-turtle_demo_004.gif" width="200"/></p>-
WordRecognition-CoreML-MLKit(preparing...)<p align="center"><img src="Resource/recognition_a_word_demo002.gif" width="200"/></p>Detect character, find a word what I point and then recognize the word using Core ML and ML Kit.

Annotation Tool

NameDEMONote
KeypointAnnotation<p align="center"><img src="Resource/annotation_ios_app_demo001.gif" width="200"/></p>Annotation tool for own custom estimation dataset

Create ML Projects

NameCreate ML DEMOCore ML DEMONote
SimpleClassification-CreateML-CoreMLIMG_0436IMG_0436A Simple Classification Using Create ML and Core ML

Performance

Execution Time: Inference Time + Postprocessing Time

(with iPhone X)Inference Time(ms)Execution Time(ms)FPS
ImageClassification-CoreML404023
MobileNet-MLKit1201306
ObjectDetection-CoreML100 ~ 120110 ~ 1305
TextDetection-CoreML121330(max)
TextRecognition-MLKit35~20040~2005~20
PoseEstimation-CoreML516514
PoseEstimation-MLKit2002173
DepthPrediction-CoreML6246401
SemanticSegmentation-CoreML1785091
WordRecognition-CoreML-MLKit233014
FaceDetection-MLKit---

📏Measure module

You can see the measured latency time for inference or execution and FPS on the top of the screen.

If you have more elegant method for measuring the performance, suggest on issue!

<img src="Resource/measure_ui.jpeg" width="320"/>

Implements

Measure📏Unit TestBunch Test
ImageClassification-CoreMLOXX
MobileNet-MLKitOXX
ObjectDetection-CoreMLOOX
TextDetection-CoreMLOXX
TextRecognition-MLKitOXX
PoseEstimation-CoreMLOOX
PoseEstimation-MLKitOXX
DepthPrediction-CoreMLOXX
SemanticSegmentation-CoreMLOXX

See also

WWDC

Core ML

Create ML and Turi Create

Common ML

Metal

AR

Examples