Awesome TensorFlow Lite Awesome PRs Welcome Twitter
TensorFlow Lite is a set of tools that help convert and optimize TensorFlow models to run on mobile and edge devices. It's currently running on more than 4 billion devices! With TensorFlow 2.x, you can train a model with tf.Keras, easily convert a model to .tflite and deploy it; or you can download a pretrained TensorFlow Lite model from the model zoo.
This is an awesome list of TensorFlow Lite models with sample apps, helpful tools and learning resources -
- Showcase what the community has built with TensorFlow Lite
- Put all the samples side-by-side for easy reference
- Share knowledge and learning resources
Please submit a PR if you would like to contribute and follow the guidelines here.
- Past announcements:
- Models with samples
- Model zoo
- Ideas and Inspiration
- ML Kit examples
- Plugins and SDKs
- Helpful links
- Learning resources
Here are some past feature annoucements of TensorFlow Lite:
- Announcement of the new converter - MLIR-based and enables conversion of new classes of models such as Mask R-CNN and Mobile BERT etc., supports functional control flow and better error handling during conversion. Enabled by default in the nightly builds.
- Android Support Library - Makes mobile development easier (Android sample code).
- Model Maker - Create your custom image & text classification models easily in a few lines of code. See below the Icon Classifier for a tutorial by the community.
- On-device training - It is finally here! Currently limited to transfer learning for image classification only but it's a great start. See the official Android sample code and another one from the community (Blog | Android).
- Hexagon delegate - How to use the Hexagon Delegate to speed up model inference on mobile and edge devices. Also see blog post Accelerating TensorFlow Lite on Qualcomm Hexagon DSPs.
- Model Metadata - Provides a standard for model descriptions which also enables Code Gen and Android Studio ML Model Binding.
Here are the TensorFlow Lite models with app / device implementations, and references. Note: pretrained TensorFlow Lite models from MediaPipe are included, which you can implement with or without MediaPipe.
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Classification | MobileNetV1 (download) | Android | iOS | Raspberry Pi | Overview | tensorflow.org |
| Classification | MobileNetV2 | Recognize Flowers on Android Codelab | Android | TensorFlow team |
| Classification | MobileNetV2 | Skin Lesion Detection Android | Community |
| Classification | MobileNetV2 | American Sign Language Detection | Colab Notebook | Android | Community |
| Classification | CNN + Quantisation Aware Training | Stone Paper Scissor Detection Colab Notebook | Flutter | Community |
| Classification | EfficientNet-Lite0 (download) | Icon Classifier Colab & Android | tutorial 1 | tutorial 2 | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Object detection | Quantized COCO SSD MobileNet v1 (download) | Android | iOS | Overview | tensorflow.org |
| Object detection | YOLO | Flutter | Paper | Community |
| Object detection | YOLOv5 | Yolov5 Inference | Community |
| Object detection | MobileNetV2 SSD (download) | Reference | MediaPipe |
| Object detection | MobileDet (Paper) | Blog post (includes the TFLite conversion process) | MobileDet is from University of Wisconsin-Madison and Google and the blog post is from the Community |
| License Plate detection | SSD MobileNet (download) | Flutter | Community |
| Face detection | BlazeFace (download) | Paper | MediaPipe |
| Face Authentication | FaceNet | Flutter | Community |
| Hand detection & tracking | Palm detection & hand landmarks (download) | Blog post | Model card | Android | MediaPipe & Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Segmentation | DeepLab V3 (download) | Android & iOS | Overview | Flutter Image | Realtime | Paper | tf.org & Community |
| Segmentation | Different variants of DeepLab V3 models | Models on TF Hub with Colab Notebooks | Community |
| Segmentation | DeepLab V3 model | Android | Tutorial | Community |
| Hair Segmentation | Download | Paper | MediaPipe |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Style transfer | Arbitrary image stylization | Overview | Android | Flutter | tf.org & Community |
| Style transfer | Better-quality style transfer models in .tflite | Models on TF Hub with Colab Notebooks | Community |
| Video Style Transfer | Download: Dynamic range models) |
Android | Tutorial | Community |
| Segmentation & Style transfer | DeepLabV3 & Style Transfer models | Project repo | Android | Tutorial | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| GANs | U-GAT-IT (Selfie2Anime) | Project repo | Android | Tutorial | Community |
| GANs | White-box CartoonGAN (download) | Project repo | Android | Tutorial | Community |
| GANs - Image Extrapolation | Boundless on TF Hub | Colab Notebook | Original Paper | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Pose estimation | Posenet (download) | Android | iOS | Overview | tensorflow.org |
| Pose Classification based Video Game Control | MoveNet Lightning (download) | Project Repository | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Low-light image enhancement | Models on TF Hub | Project repo | Original Paper | Flutter | |
| OCR | Models on TF Hub | Project Repository | Community |
| Task | Model | Sample apps | Source |
|---|---|---|---|
| Question & Answer | DistilBERT | Android | Hugging Face |
| Text Generation | GPT-2 / DistilGPT2 | Android | Hugging Face |
| Text Classification | Download | Android |iOS | Flutter | tf.org & Community |
| Text Detection | CRAFT Text Detector (Paper) | Download | Project Repository | Blog1-Conversion to TFLite | Blog2-EAST vs CRAFT | Models on TF Hub | Android (Coming Soon) | Community |
| Text Detection | EAST Text Detector (Paper) | Models on TF Hub | Conversion and Inference Notebook | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Speech Recognition | DeepSpeech | Reference | Mozilla |
| Speech Recognition | CONFORMER | Inference Android | Community |
| Speech Synthesis | Tacotron-2, FastSpeech2, MB-Melgan | Android | TensorSpeech |
| Speech Synthesis(TTS) | Tacotron2, FastSpeech2, MelGAN, MB-MelGAN, HiFi-GAN, Parallel WaveGAN | Inference Notebook | Project Repository | Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| On-device Recommendation | Dual-Encoder | Android | iOS | Reference | tf.org & Community |
| Task | Model | App | Reference | Source |
|---|---|---|---|
| Game agent | Reinforcement learning | Flutter | Tutorial | Community |
These are the TensorFlow Lite models that could be implemented in apps and things:
- MobileNet - Pretrained MobileNet v2 and v3 models.
- TensorFlow Lite models
- TensorFlow Lite models - With official Android and iOS examples.
- Pretrained models - Quantized and floating point variants.
- TensorFlow Hub - Set "Model format = TFLite" to find TensorFlow Lite models.
These are TensorFlow models that could be converted to .tflite and then implemented in apps and things:
- TensorFlow models - Official TensorFlow models.
- Tensorflow detection model zoo - Pre-trained on COCO, KITTI, AVA v2.1, iNaturalist Species datasets.
- E2E TFLite Tutorials - Checkout this repo for sample app ideas and seeking help for your tutorial projects. Once a project gets completed, the links of the TensorFlow Lite model(s), sample code and tutorial will be added to this awesome list.
ML Kit is a mobile SDK that brings Google's ML expertise to mobile developers.
- 2019年10月01日 ML Kit Translate demo - A tutorial with material design Android (Kotlin) sample - recognize, identify Language and translate text from live camera with ML Kit for Firebase.
- 2019年03月13日 Computer Vision with ML Kit - Flutter In Focus.
- 2019年02月09日 Flutter + MLKit: Business Card Mail Extractor - A blog post with a Flutter sample code.
- 2019年02月08日 From TensorFlow to ML Kit: Power your Android application with machine learning - A talk with Android (Kotlin) sample code.
- 2018年08月07日 Building a Custom Machine Learning Model on Android with TensorFlow Lite.
- 2018年07月20日 ML Kit and Face Detection in Flutter.
- 2018年07月27日 ML Kit on Android 4: Landmark Detection.
- 2018年07月28日 ML Kit on Android 3: Barcode Scanning.
- 2018年05月31日 ML Kit on Android 2: Face Detection.
- 2018年05月22日 ML Kit on Android 1: Intro.
- Edge Impulse - Created by @EdgeImpulse to help you to train TensorFlow Lite models for embedded devices in the cloud.
- MediaPipe - A cross platform (mobile, desktop and Edge TPUs) AI pipeline by Google AI. (PM Ming Yong) | MediaPipe examples.
- Coral Edge TPU - Edge hardware by Google. Coral Edge TPU examples.
- TensorFlow Lite Flutter Plugin - Provides a dart API similar to the TensorFlow Lite Java API for accessing TensorFlow Lite interpreter and performing inference in flutter apps. tflite_flutter on pub.dev.
- Netron - A tool for visualizing models.
- AI benchmark - A website for benchmarking computer vision models on smartphones.
- Performance measurement - How to measure model performance on Android and iOS.
- Material design guidelines for ML - How to design machine learning powered features. A good example: ML Kit Showcase App.
- The People + AI Guide book - Learn how to design human-centered AI products.
- Adventures in TensorFlow Lite - A repository showing non-trivial conversion processes and general explorations in TensorFlow Lite.
- TFProfiler - An Android-based app to profile TensorFlow Lite models and measure its performance on smartphone.
- TensorFlow Lite for Microcontrollers
- TensorFlow Lite Examples - Android - A repository refactors and rewrites all the TensorFlow Lite Android examples which are included in the TensorFlow official website.
- Tensorflow-lite-kotlin-samples - A collection of Tensorflow Lite Android example Apps in Kotlin, to show different kinds of kotlin implementation of the example apps
Interested but not sure how to get started? Here are some learning resources that will help you whether you are a beginner or a practitioner in the field for a while.
- 2021年11月09日 On-device training in TensorFlow Lite
- 2021年09月27日 Optical character recognition with TensorFlow Lite: A new example app
- 2021年06月16日 https://blog.tensorflow.org/2021/06/easier-object-detection-on-mobile-with-tf-lite.html
- 2020年12月29日 YOLOv3 to TensorFlow Lite Conversion - By Nitin Tiwari.
- 2020年04月20日 What is new in TensorFlow Lite - By Khanh LeViet.
- 2020年04月17日 Optimizing style transfer to run on mobile with TFLite - By Khanh LeViet and Luiz Gustavo Martins.
- 2020年04月14日 How TensorFlow Lite helps you from prototype to product - By Khanh LeViet.
- 2019年11月08日 Getting Started with ML on MCUs with TensorFlow - By Brandon Satrom.
- 2019年08月05日 TensorFlow Model Optimization Toolkit — float16 quantization halves model size - By the TensorFlow team.
- 2018年07月13日 Training and serving a real-time mobile object detector in 30 minutes with Cloud TPUs - By Sara Robinson, Aakanksha Chowdhery, and Jonathan Huang.
- 2018年06月11日 - Why the Future of Machine Learning is Tiny - By Pete Warden.
- 2018年03月30日 - Using TensorFlow Lite on Android) - By Laurence Moroney.
- 2021年12月01日 AI and Machine Learning On-Device Development (early access) - By Laurence Moroney (@lmoroney).
- 2020年10月01日 AI and Machine Learning for Coders - By Laurence Moroney (@lmoroney).
- 2020年04月06日 Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter: Build scalable real-world projects to implement end-to-end neural networks on Android and iOS (GitHub) - By Anubhav Singh (@xprilion) and Rimjhim Bhadani (@Rimjhim28).
- 2020年03月01日 Raspberry Pi for Computer Vision (Complete Bundle | TOC) - By the PyImageSearch Team: Adrian Rosebrock (@PyImageSearch), David Hoffman, Asbhishek Thanki, Sayak Paul (@RisingSayak), and David Mcduffee.
- 2019年12月01日 TinyML - By Pete Warden (@petewarden) and Daniel Situnayake (@dansitu).
- 2019年10月01日 Practical Deep Learning for Cloud, Mobile, and Edge - By Anirudh Koul (@AnirudhKoul), Siddha Ganju (@SiddhaGanju), and Meher Kasam (@MeherKasam).
- 2021年10月06日 Contributing to TensorFlow Lite with Sunit Roy (Hacktoberfest 2021)
- 2020年07月25日 Android ML by Hoi Lam (GDG Kolkata meetup).
- 2020年04月01日 Easy on-device ML from prototype to production (TF Dev Summit 2020).
- 2020年03月11日 TensorFlow Lite: ML for mobile and IoT devices (TF Dev Summit 2020).
- 2019年10月31日 Keynote - TensorFlow Lite: ML for mobile and IoT devices.
- 2019年10月31日 TensorFlow Lite: Solution for running ML on-device.
- 2019年10月31日 TensorFlow model optimization: Quantization and pruning.
- 2019年10月29日 Inside TensorFlow: TensorFlow Lite.
- 2018年04月18日 TensorFlow Lite for Android (Coding TensorFlow).
- 2020年08月08日 Talking Machine Learning with Hoi Lam.
- Introduction to TensorFlow Lite - Udacity course by Daniel Situnayake (@dansitu), Paige Bailey (@DynamicWebPaige), and Juan Delgado.
- Device-based Models with TensorFlow Lite - Coursera course by Laurence Moroney (@lmoroney).
- The Future of ML is Tiny and Bright - A series of edX courses created by Harvard in collaboration with Google. Instructors - Vijay Janapa Reddi, Laurence Moroney, and Pete Warden.