Porting of "TensorFlow Lite Examples" to Unity. and some utilities for Unity.
Tested on
- iOS / Android / macOS / Windows
- Unity 2019.4.17f1
- TensorFlow 2.4.0
Samples
- TensorFlow
- MNIST
- SSD Object Detection
- DeepLab
- PoseNet
- Style Transfer
- Text Classification
- Bert Question and Answer
- MediaPipe
- Hand Tracking
- Blaze Face
- Face Mesh
- Blaze Pose (Upper body)
- MLKit
- Blaze Pose (Full body)
Included prebuilt libraries
iOS | Android | macOS | Ubuntu | Windows | |
---|---|---|---|---|---|
Core CPU | ✅ | ✅ | ✅ | ✅ | ✅ |
Metal Delegate | ✅ | - | ✅ | - | - |
OpenGL Delegate | - | ✅ | - | - | - |
NNAPI Delegate | - | ✅ | - | - | - |
- All libraries except iOS are targeted 64bit platform: arm64 or x86_64.
- Clone this repository with examples
- Need Git-LFS to build for iOS
- Or core library is available on OpenUPM
Pre-built libraries are included. If you want to build the latest TFLite,
- Clone TensorFlow library
- Run
./configure
in the TensorFlow library - Run
./build_tflite.py
(Python3) to build for each platform
# Update iOS, Andoid and macOS
./build_tflte.py --tfpath ../tensorflow -ios -android -macos
- To build macOS Metal Delegate on TensorFlow v2.3.0 or later, You need to apply following changes the issue
[Android] You can see logs from tflite by filtering with "tflite"
# Filtering logcat only Unity and tflite
adb logcat Unity:V tflite:V "*:S"
Samples folder Assets/Samples/*
is licensed under MIT
Other licenses
- TensorFlow
- Assets/StreamingAssets/*.tflite Models
- Assets/StreamingAssets/mediapipe Models
- Some MediaPipe C# codes are based on terryky/tflite_gles_app