{"id":28137252,"url":"https://github.com/dailystudio/tensorflow-lite-examples-android","last_synced_at":"2025-05-14T16:23:42.544Z","repository":{"id":41284084,"uuid":"267263865","full_name":"dailystudio/tensorflow-lite-examples-android","owner":"dailystudio","description":"Examples of Tensorflow  Lite on Android","archived":false,"fork":false,"pushed_at":"2022-09-29T08:37:11.000Z","size":87830,"stargazers_count":71,"open_issues_count":3,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T21:15:51.067Z","etag":null,"topics":["android","bert","camerax","deeplab","digit-classifier","image-classification","image-segmentation","kotlin-android","machine-learning","minst","mobile-machine-learning","object-detection","posenet","smart-reply","speech-recognition","style-transfer","tensorflow","tensorflow-lite","text-classification"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dailystudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T08:28:15.000Z","updated_at":"2024-11-26T01:32:57.000Z","dependencies_parsed_at":"2022-07-07T03:32:44.331Z","dependency_job_id":null,"html_url":"https://github.com/dailystudio/tensorflow-lite-examples-android","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailystudio%2Ftensorflow-lite-examples-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailystudio%2Ftensorflow-lite-examples-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailystudio%2Ftensorflow-lite-examples-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailystudio%2Ftensorflow-lite-examples-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dailystudio","download_url":"https://codeload.github.com/dailystudio/tensorflow-lite-examples-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254180151,"owners_count":22027937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","bert","camerax","deeplab","digit-classifier","image-classification","image-segmentation","kotlin-android","machine-learning","minst","mobile-machine-learning","object-detection","posenet","smart-reply","speech-recognition","style-transfer","tensorflow","tensorflow-lite","text-classification"],"created_at":"2025-05-14T16:21:31.939Z","updated_at":"2025-05-14T16:23:42.533Z","avatar_url":"https://github.com/dailystudio.png","language":"Kotlin","funding_links":[],"categories":["Helpful links"],"sub_categories":["TensorFlow models"],"readme":"# TensorFlow Lite Examples - Android\n\nThis repository refactors and rewrites all the TensorFlow Lite examples for Android. They are officially illustrated on the TensorFlow official website. For more details, please refer to:\n\n[https://www.tensorflow.org/lite/examples](https://www.tensorflow.org/lite/examples)\n\nMost of these examples are maintained by Googlers. But of all the maintainers are experts in Android. The quality and readability are not good enough. This repository's target is to recreate these examples, with the same UI designs, with the same approaches to run inference, and provide you base facilities to do machine learning in a much simpler way on Android. It helps you quickly understand how a captured Bitmap, a small buffer of raw audio data, or a piece of text are converted to run in inferences and how to represent results on the user interface.\n\n[![](.github/youtube.png)](https://www.youtube.com/watch?v=ctn-t1pg9pA\u0026feature=youtu.be)\n\n## Examples\n\nCurrently, this repository has covered almost all the examples on the official website. The rest of them are still under development. All of these examples are synchronized periodically with the official repository. \n\nHere is a list of the covered cases:\n\n### Vision\n- [Image Classification](./example-image-classification) \n\t\n\tTest an image classification solution with a pre-trained model that can recognize 1000 different types of items from input frames on a mobile camera.\n\n- [Object Detection](./example-object-detection)\n\n\tTest an image classification solution with a pre-trained model that can recognize 1000 different types of items from input frames on a mobile camera.\n\n- [Pose estimation](./example-posenet)\n\t\n\tExplore an app that estimates the poses of people in an image.\n\n- [Gesture recognition](./example-gesture)\n\t\n\tTrain a neural network to recognize gestures caught on your webcam using TensorFlow.js, then use TensorFlow Lite to convert the model to run inference on your device.\n\n- [Smart reply](./example-smart-reply)\n\t\n\tGenerate reply suggestions to input conversational chat messages.\n\n- [Image segmentation](./example-image-segmentation)\n\t\n\tPredict whether each pixel of an image is associated with a certain class. Trained with people, places, animals, and more.\n\n- [Style transfer](./example-style-transfer)\n\t\n\tApply any styles on an input image to create a new artistic image.\n\n- [Digit classifier](./example-digit-classifier)\n\t\n\tUse a TensorFlow Lite model to classify your handwritten digits.\n- [Video classification](./example-video-classification)\n\t\n\tIdentify human actions in video footage.\n\n- [Super resolution](./example-super-resolution)\n\t\n\tGenerate a super-resolution image from a low-resolution image.\n\n- [Optical character recognition](./example-optical-character-recognition)\n\t\n\tExtract texts from images using Optical Character Recognition with TensorFlow Lite.\n\n### Natural Language\n\n- [Text classification](./example-text-classification)\n\t\n\tCategorize free text into predefined groups. Potential applications include abusive content moderation, tone detection, and more.\n\n- [Question and answer](./example-bert-qa)\n\t\n\tAnswer user queries based on information extracted from a given text archive.\n\n### Others\n\n- [Speech recognition](./example-speech-recognition)\n\n\tExplore an app that uses a microphone to spot keywords and return a probability score for the words spoken.\n\n- [Reinforcement learning](./example-reinforcement-learning)\n\t\n\tTrain a game agent using reinforcement learning and build an Android game using TensorFlow Lite.\n\n- [On-device training](./example-model-personalization)\n\t\n\tTrain a TensorFlow Lite model on-device.\n\n## TensorFlow Lite eXetremes\n\n[TensorFlow Lite eXetrems](https://search.maven.org/artifact/cn.dailystudio/tensorflow-litex) is an open-source library that is just extracted during the recreation of the examples in this repo. It helps you build machine learning tasks in Android apps with less work wasted on repetitive routines, like permission handling, Camera setup, acceleration selection, inference statistics and show up, etc.\n\nFor more detailed information, pelase refer to [tensorflow-litex](./tensorflow-litex) in this repo.\n\n\n## Templates\nTo make it easy to create your new example application, there are a few of boilerplate projects under the [templates](./templates) directory.\n\n- [example-template](./templates/example-template), an empty project with the same basic UI as other examples in the repository. You can build your TensorFlow Lite example from scratch. \n\n- [example-template-with-litex](./templates/example-template), an empty project with the same basic UI as other examples in the repository. You can build your TensorFlow Lite example from scratch. Compare to the one above, it uses [a pre-built library](https://search.maven.org/artifact/cn.dailystudio/tensorflow-litex/1.4.5/aar) in the Maven Central instead of a module project \"tensorflow-litex\" in this repository.\n\n- [example-image-template](./templates/example-image-template), more than providing the same design style as examples in the repository, it also includes basic facilities that support camera features. You can build your TensorFlow Lite example that requires Camera support.\n\n- [example-image-template-with-litex](./templates/example-image-template), more than providing the same design style as examples in the repository, it also includes basic facilities that support camera features. You can build your TensorFlow Lite example that requires Camera support. Compare to the one above, it uses [a pre-built library](https://search.maven.org/artifact/cn.dailystudio/tensorflow-litex/1.4.5/aar) in the Maven Central instead of a module project \"tensorflow-litex\" in this repository.\n\n\nThere is also a [script](./scripts) that helps to create your project quickly from the boilerplate.\n\n## Performance\n\nHere is the performance test results on two Android phones and with two different Android versions. \n\nCompare to the official [performance tool](https://www.tensorflow.org/lite/performance/measurement) provided by TensorFlow Lite, the results are taken in a realistic running environment, which is also affected by other parts of the application and potential hardware resource occupation.\n\nIn this test, Oneplus 7 (Snapdragon 855) is a flagship device in 2019, whereas Oneplus 9 (Snapdragon 888) is a flagship device in 2021. Oneplus 7 is running with Android 11, while Oneplus 9 is running with Android 12. Both of them have 12 RAM on the device.\n\n[![](.github/performance.png)]()\n\n\n## License\n\n    Copyright 2022 Daily Studio.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailystudio%2Ftensorflow-lite-examples-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdailystudio%2Ftensorflow-lite-examples-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailystudio%2Ftensorflow-lite-examples-android/lists"}