• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    Swift
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The baseline project for inferencing various Pose Estimation tflite models with TFLiteSwift on iOS

logo-pose-estimatiton-for-tflite-3

platform-ios swift-version lisence PRs Welcome

This project is Pose Estimation on iOS with TensorFlow Lite.
If you are interested in iOS + Machine Learning, visit here you can see various DEMOs.

2D pose estimation in real-time 3D pose estimation

Features

  • Support 2D pose estimaiton TFLite models
    • Real-time demo with Metal framwork
    • Photo album demo
  • Support 3D pose estimation TFLite model
    • Real-time demo with Metal framwork (but realtime model is not ready yet)
    • Real-time pose matching demo
    • Photo album demo
  • Render the result keypoints of 2D pose estimation in 2D demo page
  • Render the result keypoints of 3D pose estimation with SceneKit
  • Render the heatmaps of 2D pose estimation output
    • Part Confidence Maps for typical heatmap based models
    • Part Affinity Fields for OpenPose (2D multi-person)
  • Implemented pose-matching with cosine similiarity in 3D pose demo
  • Implemented to fix the shoulders' keypoints in 3D pose estimation to pre-process for pose-matching

Models

Source Images

Name gif img-0 img-1 img-2
Source -

Joint Samples

Model Names gif img-0 img-1 img-2
PoseNet - pose-demo-linedot-posenet-0 pose-demo-linedot-posenet-2 pose-demo-linedot-posenet-3
PEFM CPM - pose-demo-PEFMCPM-0 pose-demo-PEFMCPM-2 pose-demo-PEFMCPM-3
PEFM Hourglass - pose-demo-PEFMHourglass-0 pose-demo-PEFMHourglass-2 pose-demo-PEFMHourglass-3
OpenPose (multi-person) - pose-demo-openpose-0 pose-demo-openpose-2 pose-demo-openpose-3

Heatmap-ConfidenceMap Samples

Model Names gif img-0 img-1 img-2
PoseNet - - - -
PEFM CPM - pose-demo-heatmap-PEFMCPM-0 pose-demo-heatmap-PEFMCPM-2 pose-demo-heatmap-PEFMCPM-3
PEFM Hourglass - pose-demo-heatmap-PEFMHourglass-0 pose-demo-heatmap-PEFMHourglass-2 pose-demo-heatmap-PEFMHourglass-3
OpenPose (multi-person) - pose-demo-heatmap-posenet-0 pose-demo-heatmap-posenet-2 pose-demo-heatmap-posenet-3

Heatmap-PAF Samples

Model Names gif img-0 img-1 img-2
OpenPose (PAF x) - pose-demo-heatmap-pafx-PEFMHourglass-0 pose-demo-heatmap-pafx-PEFMHourglass-2 pose-demo-heatmap-pafx-PEFMHourglass-3
OpenPose (PAF y) - pose-demo-heatmap-pafy-PEFMHourglass-0 pose-demo-heatmap-pafy-PEFMHourglass-2 pose-demo-heatmap-pafy-PEFMHourglass-3

Meta Data

2D

โœ… vs โ˜‘๏ธ Name Size Inference
Time
on iPhone11Pro
Post-process
Time
on iPhone11Pro
PCKh-0.5 multi person
vs
single person
Model Source Paper tflite
download
โœ… PoseNet 13.3 MB - - - single tensorflow/tensorflow PersonLab
โœ… PEFM CPM 2.4 MB - - - single edvardHua/PoseEstimationForMobile Convolutional Pose Machines
โœ… PEFM Hourglass v1 1.8 MB - - - single edvardHua/PoseEstimationForMobile Stacked Hourglass Networks
โœ… PEFM Hourglass v2 1.7 MB - - - single edvardHua/PoseEstimationForMobile Stacked Hourglass Networks
โœ… OpenPose 7.8 MB - - - multi ildoonet/tf-pose-estimation OpenPose
โ˜‘๏ธ AlphaPose - - - - single osmr/imgclsmob RMPE
โ˜‘๏ธ SelecSLS - - - - single osmr/imgclsmob -
โ˜‘๏ธ IBPPose - - - - single osmr/imgclsmob -
โ˜‘๏ธ Lightweight OpenPose - - - - single osmr/imgclsmob OpenPose

3D

โœ… vs โ˜‘๏ธ Name Size Inference
Time
on iPhone11Pro
Post-process
Time
on iPhone11Pro
(metric) Model Source Paper tflite
download
โœ… Baseline3DPose 137.1 MB 347 ms 79 ms - mks0601/3DMPPE_POSENET_RELEASE Baseline3D download
โœ… LiteBaseline3DPose 16.6 MB 116 ms
(cpu only)
19 ms
(cpu only)
SangbumChoi/MobileHumanPose MHP download

Requirements

  • Xcode 11.3+
  • iOS 11.0+
  • Swift 5
  • CocoaPods
gem install cocoapods

Build & Run

  1. Install dependencies with cocoapods
cd ~/{PROJECT_PATH}
pod install
  1. Open the PoseEstimation-TFLiteSwift.xcworkspace and run the project

See also

License

This repository is licensed under Apache 2.0. Full license text is available in LICENSE.

More Repositories

1

awesome-ml-demos-with-ios

The challenge projects for Inferencing machine learning models on iOS
Python
1,191
star
2

PoseEstimation-CoreML

The example project of inferencing Pose Estimation using Core ML
Swift
677
star
3

SemanticSegmentation-CoreML

The example project of inferencing Semantic Segementation using Core ML
Swift
316
star
4

ObjectDetection-CoreML

An example running Object Detection using Core ML (YOLOv8, YOLOv5, YOLOv3, MobileNetV2+SSDLite)
Swift
282
star
5

tf2-mobile-2d-single-pose-estimation

๐Ÿ’ƒ Pose estimation for iOS and android using TensorFlow 2.0
Python
167
star
6

DepthPrediction-CoreML

The example of running Depth Prediction using Core ML
Swift
134
star
7

TextRecognition-MLKit

Swift
88
star
8

TextDetection-CoreML

Swift
79
star
9

FingertipEstimation-CoreML

Detect fingertip by using machine learning for pose estimation
Swift
71
star
10

KeypointAnnotation

Swift
42
star
11

ImageClassification-CoreML

The example of running Image Classification using Core ML
Swift
42
star
12

TFLiteSwift-Vision

Swift
38
star
13

FaceDetection-MLKit

Swift
21
star
14

PoseEstimation-MLKit

The example of running Pose Estimation using ML Kit
Swift
17
star
15

SimpleClassification-CreateML-CoreML

Create ML๋กœ ๋‚˜๋งŒ์˜ Classifier ๋ชจ๋ธ์„ ๋งŒ๋“ค๊ณ  Core ML๋กœ ์•ฑ์—์„œ ์‚ฌ์šฉํ•ด๋ณด๋Š” End-to-End ์˜ˆ์ œ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค.
Swift
14
star
16

InstanceSegmentation-CoreML

Swift
12
star
17

MobileNet-MLKit

MLKit์„ ์‚ฌ์šฉํ•˜์—ฌ MobileNet.tflite๋ฅผ ์‹คํ–‰์‹œ์ผœ๋ณธ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค.
Swift
11
star
18

GyroMaze-STM32

์ž„๋ฒ ๋””๋“œ ์‹คํ—˜์—์„œ ํ…€ ํ”„๋กœ์ ํŠธ ๊ฒฐ๊ณผ๋ฌผ์ž…๋‹ˆ๋‹ค.
C
7
star
19

pytorch-Korean-NER

Python
5
star
20

HangeulClock-iOS

Objective-C
5
star
21

MNIST-TFLiteSwift

Swift
4
star
22

MyBookshelf-iOS

The assignment is to see code design, code accuracy, data structure, algorithms, and learning abilities, as well as the ability to implement your app.
Objective-C
4
star
23

excel-example-ios

libxlsxwriter(C๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ)๋ฅผ iOS์—์„œ ์‚ฌ์šฉํ•œ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค.
Swift
4
star
24

image-clustering-browser

Python
3
star
25

WordRecognition-CoreML-MLKit

Detect character, find a word what I point and then recognize the word using Core ML and ML Kit.
3
star
26

ZoomableScrollView

Simple Zoomable Scroll View inherited from UIScrollView
Swift
3
star
27

async-filtering-photo-album-ios

Swift
2
star
28

tc-stock-management-system

1
star
29

MLProblem-MLFramework-for-iOS-template-project

Swift
1
star
30

tucan9389.github.io

HTML
1
star
31

mnist-ml-to-mobile

Python
1
star