Awesome tensorflow lite
TensorFlow Lite 是一组工具,可帮助转换和优化 TensorFlow 模型以在移动和边缘设备上运行. 它目前在超过 40 亿台设备上运行! 使用 TensorFlow 2.x,您可以使用 tf.Keras 训练模型,轻松将模型转换为 .tflite 并进行部署; 或者您可以从模型动物园下载预训练的 TensorFlow Lite 模型.
Awesome tensorflow lite
Awesome TensorFlow Lite
¶
TensorFlow Lite 是一组工具,可帮助转换和优化 TensorFlow 模型以在移动和边缘设备上运行. 它目前在超过 40 亿台设备上运行! 使用 TensorFlow 2.x,您可以使用 tf.Keras 训练模型,轻松将模型转换为 .tflite 并进行部署; 或者您可以从模型动物园下载预训练的 TensorFlow Lite 模型.
这是一个很棒的 TensorFlow Lite 模型列表,其中包含示例应用程序、有用的工具和学习资源 - * 展示社区使用 TensorFlow Lite 构建的内容 * 将所有示例并排放置以便于参考 * 分享知识和学习资源
如果您想贡献并遵循指南,请提交 PR here.
##内容
Past announcements:¶
以下是 TensorFlow Lite 过去的一些功能公告: * Announcement of the new converter - MLIR基于并支持新类模型的转换,例如 Mask R-CNN 和 Mobile BERT 等,支持功能控制流和转换期间更好的错误处理. 在夜间构建中默认启用. * Android Support Library - 使移动开发更容易(Android 示例代码). * Model Maker - 创建您的自定义 image & text 只需几行代码即可轻松建立分类模型. 请参阅下面的图标分类器,了解社区提供的教程. * On-device training - 终于来了! 目前仅限于图像分类的迁移学习,但这是一个很好的开始. 见官方 Android 示例代码和另一个来自社区的代码(Blog | Android). * Hexagon delegate - 如何使用 Hexagon Delegate 加速移动和边缘设备上的模型推理. 另见博文 Accelerating TensorFlow Lite on Qualcomm Hexagon DSPs. * Model Metadata - 提供模型描述的标准,这也使 Code Gen and Android Studio ML Model Binding.
Models with samples¶
以下是带有应用程序/设备实现和参考的 TensorFlow Lite 模型. 注意:包含来自 MediaPipe 的预训练 TensorFlow Lite 模型,您可以使用或不使用 MediaPipe 来实现.
Computer vision¶
Classification¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 分类 | MobileNetV1 (download) | Android | iOS | Raspberry Pi | Overview | tensorflow.org |
| 分类 | MobileNetV2 | 在 Android 上认花 Codelab | Android | TensorFlow 团队 |
| 分类 | MobileNetV2 | 皮损检测 Android | 社区 |
| 分类 | MobileNetV2 | 美国手语检测| Colab Notebook | Android | 社区 |
| 分类 | CNN + 量化意识训练 | 石头剪刀布检测 Colab Notebook | Flutter | 社区 |
| 分类 | EfficientNet-Lite0 (download ) | 图标分类器 Colab & Android | tutorial 1 | tutorial 2 | 社区 |
Detection¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 物体检测 | 量化的 COCO SSD MobileNet v1 (download) | Android | iOS | Overview | tensorflow.org |
| 物体检测 | 约洛 | Flutter | Paper | 社区 |
| 物体检测 | YOLOv5 | Yolov5 Inference | 社区 |
| Object detection | MobileNetV2 SSD (download) | Reference | 媒体管道 |
| 物体检测 | 移动数据 (Paper) | Blog post (includes the TFLite conversion process) | MobileDet 来自威斯康星大学麦迪逊分校和谷歌,博文来自社区 |
| 车牌检测 | SSD移动网络 (download) | Flutter | 社区 |
| 人脸检测 | 火焰脸 (download) | Paper | 媒体管道 |
| 人脸认证 | FaceNet | Flutter | 社区 |
| 手部检测与追踪 | 手掌检测和手部地标(download) | Blog post | Model card | Android | MediaPipe 与社区 |
Segmentation¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 分割 | DeepLab V3(download) | Android & iOS | Overview | 扑 Image | Realtime | Paper | tf.org 与社区 |
| 分割 | 的不同变体 DeepLab V3 models | 模型上 TF Hub 使用 Colab 笔记本 | 社区 |
| 分割 | DeepLab V3 model | Android | Tutorial | 社区 |
| 头发分割 | Download | Paper | 媒体管道 |
Style Transfer¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 风格迁移 | Arbitrary image stylization | Overview | Android | Flutter | tf.org 与社区 |
| 风格迁移 | .tflite 中质量更好的风格迁移模型 | 模型上 TF Hub 使用 Colab 笔记本 | 社区 |
| 视频风格迁移 | 下载: Dynamic range models) |
Android | Tutorial | 社区 |
| 分割和风格迁移 | DeepLabV3 和风格迁移 models | Project repo | Android | Tutorial | 社区 |
| #### Generative | |||
| 任务 | 型号 | 应用| 参考 | 来源 |
| - | - | - | - |
| GAN | U-GAT-IT (Selfie2Anime) | Project repo | Android | Tutorial | 社区 |
| GAN | White-box CartoonGAN (download) | Project repo | Android | Tutorial | 社区 |
| GANs - 图像外推 | 无边无际 TF Hub | Colab Notebook | Original Paper | 社区 |
| #### Post estimation | |||
| 任务 | 型号 | 应用| 参考 | 来源 |
| - | - | - | - |
| 姿势估计 | 波塞内特 (download) | Android | iOS | Overview | tensorflow.org |
| 基于姿势分类的视频游戏控制 | MoveNet 闪电 (download) | Project Repository | 社区 |
Other¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 弱光图像增强 | Models on TF Hub | Project repo | Original Paper | Flutter | |
| 文字识别 | Models on TF Hub | Project Repository | 社区 |
Text¶
| 任务 | 型号 | 示例应用 | 来源 |
|---|---|---|---|
| 问与答 | 蒸馏器 | Android | 拥抱的脸 |
| 文本生成 | GPT-2 / DistilGPT2 | Android | 拥抱的脸 |
| 文本分类 | Download | Android |iOS | Flutter | tf.org 与社区 |
| 文本检测 | 工艺文本检测器(Paper) | Download | Project Repository | Blog1-Conversion to TFLite | Blog2-EAST vs CRAFT | Models on TF Hub | Android(即将推出) | 社区 |
| 文本检测 | EAST文本检测器(Paper) | Models on TF Hub | Conversion and Inference Notebook | 社区 |
Speech¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 语音识别 | 深度语音 | Reference | 摩斯拉 |
| 语音识别 | 符合者 | Inference Android | 社区 |
| 语音合成 | Tacotron-2、FastSpeech2、MB-Melgan | Android | 张量语音 |
| 语音合成(TTS) | Tacotron2、FastSpeech2、MelGAN、MB-MelGAN、HiFi-GAN、并行 WaveGAN | Inference Notebook | Project Repository | 社区 |
Recommendation¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 设备端推荐 | Dual-Encoder | Android | iOS | Reference | tf.org 与社区 |
Game¶
| 任务 | 型号 | 应用| 参考 | 来源 |
|---|---|---|---|
| 游戏代理 | 强化学习 | Flutter | Tutorial | 社区 |
Model zoo¶
TensorFlow Lite models¶
这些是可以在应用程序和事物中实现的 TensorFlow Lite 模型: * MobileNet - 预训练的 MobileNet v2 和 v3 模型. * TensorFlow Lite 模型 * TensorFlow Lite models - 使用官方 Android 和 iOS 示例. * Pretrained models - 量化和浮点变体. * TensorFlow Hub - 设置“模型格式 = TFLite”以查找 TensorFlow Lite 模型.
TensorFlow models¶
这些是 TensorFlow 模型,可以转换为 .tflite,然后在应用程序和事物中实现: * TensorFlow models - 官方 TensorFlow 模型. * Tensorflow detection model zoo - 在 COCO、KITTI、AVA v2.1、iNaturalist Species 数据集上进行了预训练.
Ideas and Inspiration¶
- E2E TFLite Tutorials - 查看此存储库以获取示例应用创意并为您的教程项目寻求帮助. 项目完成后,TensorFlow Lite 模型、示例代码和教程的链接将添加到这个很棒的列表中.
ML Kit examples¶
ML Kit 是一种移动 SDK,可将 Google 的 ML 专业知识带给移动开发人员. * 2019-10-01 ML Kit Translate demo - 材料设计教程 Android (Kotlin) 示例 - 使用 ML Kit for Firebase 识别、识别语言并翻译来自实时摄像头的文本. * 2019-03-13 Computer Vision with ML Kit - Flutter In Focus. * 2019-02-09 Flutter + MLKit: Business Card Mail Extractor - 一篇博客文章 Flutter 示例代码. * 2019-02-08 From TensorFlow to ML Kit: Power your Android application with machine learning - 与谈话 Android (Kotlin) 示例代码. * 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.
Plugins and SDKs¶
- Edge Impulse - 由...制作 @EdgeImpulse 帮助您为云端的嵌入式设备训练 TensorFlow Lite 模型.
- MediaPipe - Google AI 的跨平台(移动、桌面和边缘 TPU)AI 管道. (下午 Ming Yong) | MediaPipe examples.
- Coral Edge TPU - Google 的边缘硬件. Coral Edge TPU examples.
- TensorFlow Lite Flutter Plugin - 提供类似于 TensorFlow Lite Java API 的 dart API,用于访问 TensorFlow Lite 解释器并在 flutter 应用程序中执行推理. tflite_flutter on pub.dev.
Helpful links¶
- Netron - 可视化模型的工具.
- AI benchmark - 一个用于在智能手机上对计算机视觉模型进行基准测试的网站.
- Performance measurement - 如何在 Android 和 iOS 上衡量模型性能.
- Material design guidelines for ML - 如何设计机器学习驱动的功能. 一个很好的例子: ML Kit Showcase App.
- The People + AI Guide book - 了解如何设计以人为本的 AI 产品.
- Adventures in TensorFlow Lite - 一个存储库,显示了 TensorFlow Lite 中的重要转换过程和一般探索.
- TFProfiler - 基于 Android 的应用程序,用于分析 TensorFlow Lite 模型并测量其在智能手机上的性能.
- TensorFlow Lite for Microcontrollers
- TensorFlow Lite Examples - Android - 存储库重构和重写了 TensorFlow 官方网站中包含的所有 TensorFlow Lite Android 示例.
- Tensorflow-lite-kotlin-samples - Kotlin 中的 Tensorflow Lite Android 示例应用程序集合,以展示不同种类的 kotlin 实现 example apps
Learning resources¶
有兴趣但不确定如何开始? 这里有一些学习资源,无论您是初学者还是该领域的从业者,都会对您有所帮助.
Blog posts¶
- 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 - 尼廷·蒂瓦里 (Nitin Tiwari).
- 2020-04-20 What is new in TensorFlow Lite - Khanh LeViet 着.
- 2020-04-17 Optimizing style transfer to run on mobile with TFLite - 作者:Khanh LeViet 和 Luiz Gustavo Martins.
- 2020-04-14 How TensorFlow Lite helps you from prototype to product - Khanh LeViet 着.
- 2019-11-08 Getting Started with ML on MCUs with TensorFlow - 布兰登萨特罗姆.
- 2019-08-05 TensorFlow Model Optimization Toolkit — float16 quantization halves model size - 由 TensorFlow 团队提供.
- 2018-07-13 Training and serving a real-time mobile object detector in 30 minutes with Cloud TPUs - Sara Robinson、Aakanksha Chowdhery 和 Jonathan Huang 着.
- 2018-06-11 - Why the Future of Machine Learning is Tiny - 皮特监狱长.
- 2018-03-30 - Using TensorFlow Lite on Android) - 劳伦斯·莫罗尼 (Laurence Moroney).
Books¶
- 2021-12-01 AI and Machine Learning On-Device Development (抢先体验)-劳伦斯·莫罗尼 (Laurence Moroney) (@lmoroney).
- 2020-10-01 AI and Machine Learning for Coders - 劳伦斯莫罗尼 (@lmoroney).
- 2020-04-06 Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter:构建可扩展的真实世界项目以在 Android 和 iOS 上实现端到端神经网络(GitHub) - 阿努巴夫辛格 (@xprilion) 和 Rimjhim Bhadani (@Rimjhim28).
- 2019-12-01 TinyML - 皮特监狱长 (@petewarden) 和 Daniel Situnayake (@dansitu).
- 2019-10-01 Practical Deep Learning for Cloud, Mobile, and Edge - 阿尼鲁德·库尔 (Anirudh Koul)@AnirudhKoul悉达甘珠(@SiddhaGanju), 和梅赫卡萨姆 (@MeherKasam).
Videos¶
- 2021-10-06 Contributing to TensorFlow Lite with Sunit Roy (黑客啤酒节 2021)
- 2020-07-25 Android ML by Hoi Lam (GDG 加尔各答聚会).
- 2020-04-01 Easy on-device ML from prototype to production (TF 开发峰会 2020).
- 2020-03-11 TensorFlow Lite: ML for mobile and IoT devices (TF 开发峰会 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).
Podcasts¶
- 2020-08-08 Talking Machine Learning with Hoi Lam.
MOOCs¶
- Introduction to TensorFlow Lite - Daniel Situnayake (@dansitu)、Paige Bailey (@DynamicWebPaige), 和胡安·德尔加多.
- Device-based Models with TensorFlow Lite - Laurence Moroney 的 Coursera 课程(@lmoroney).
- The Future of ML is Tiny and Bright - 哈佛与谷歌合作创建的一系列 edX 课程. 讲师 - Vijay Janapa Reddi、Laurence Moroney 和 Pete Warden.
