Coder Social home page Coder Social logo

dailystudio / tflite-run-inference-with-metadata Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 37.98 MB

This repostiory illustrates three approches of using TensorFlow Lite models with metadata on Android platforms.

License: GNU General Public License v2.0

Kotlin 77.75% Java 22.25%
tensorflow-lite android-studio metadata android camera tensorflow-hub food-classification insects-classification birds-classifier

tflite-run-inference-with-metadata's Introduction

Run TensorFlow Lite models with metadata on Android

This repository illustrates three approaches to use TensorFlow Lite models with metadata on Android platforms.

TensorFlow Lite inference with metadata

TensorFlow Lite metadata contains a rich description of what the model does and how to use the model. It can empower code generators to automatically generate the inference code for you. Plus, It can also be used to configure your custom inference pipeline.

According to different complexity and requirement, TensorFlow Lite provides several ways to leverage powerful metadata to accelerate on-deive machine learning:

  • Android Studio ML Model Binding is tooling available within Android Studio to import the TensorFlow Lite model through a graphical interface. Android Studio will automatically configure settings for the project and generate wrapper classes based on the model metadata.

  • TensorFlow Lite Code Generator is an executable that generates a model interface automatically based on the metadata. It currently supports Android with Java. The wrapper code removes the need to interact directly with ByteBuffer. Instead, developers can interact with the TensorFlow Lite model with typed objects such as Bitmap and Rect. Android Studio users can also get access to the codegen feature through Android Studio ML Binding.

  • TensorFlow Lite Task Library provides optimized ready-to-use model interfaces for popular machine learning tasks, such as image classification, question, and answer, etc. The model interfaces are specifically designed for each task to achieve the best performance and usability. Task Library works cross-platform and is supported on Java, C++, and Swift.

  • TensorFlow Lite Support Library is a cross-platform library that helps to customize the model interface and build inference pipelines. It contains varieties of util methods and data structures to perform pre/post-processing and data conversion. It is also designed to match the behavior of TensorFlow modules, such as TF.Image and TF.Text, ensuring consistency from training to inferencing.

Directories

  • boilerplate Project boilerplate. It includes a basic structure of a camera-based TensorFlow Lite application. Developers only need to focus on their specific inference codes without any knowledge about the rest parts of the app.
  • ml-model-binding Complete source codes of a bird recognition application. It demonstrates how to use ML Model Binding with TensorFlow Lite models.
  • codegen Complete source codes of a food recognition application. It demonstrates how to use TensorFlow Lite Code Generator with TensorFlow Lite models.
  • tflite-task-api Complete source codes of an insects recognition application. It demonstrates how to use TensorFlow Lite Task Library with TensorFlow Lite models.

License

Copyright 2021 Daily Studio.

Licensed under the GNU General Public License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

tflite-run-inference-with-metadata's People

Contributors

dailystudio avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.