GithubHelp home page GithubHelp logo

linkazoo / tflite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhenhuaw-me/tflite

0.0 0.0 0.0 15.94 MB

Parse TFLite models (*.tflite) EASILY with Python.

Home Page: https://jackwish.net/tflite

License: Apache License 2.0

Python 97.92% Shell 2.08%

tflite's Introduction

Easily Parse TFLite Models with Python

Build and Test

This tflite package parses TensorFlow Lite (TFLite) models (*.tflite), which are built by TFLite converter. For background, please refer to Introducing TFLite Parser Python Package.

Usage

Install the package and use it like what you build from the TensorFlow codebase. It's recommended to install the version that same as the TensorFlow that generates the TFLite model.

pip install tensorflow==2.3.0
pip install tflite==2.3.0

Enhancements

The generated python package is not friendly to use sometimes. We have introduced several enhancements:

  • Easy import: A sigle import tflite (example) to replace importing every classes and funtions in tflite (example).
  • Builtin opcode helper: The opcode is encoded as digits which is hard to parse for human. Two APIs added to make it easy to use.

Compatibility Handling

TensorFlow sometimes leaves compability hanlding of the TFLite model to the users. As these are API breaking change that can be easily fixed, we do this in the tflite package.

Contributing Updates

As the operator definition may change across different TensorFlow versions, this package needs to be updated accordingly. If you notice that the package is out of date, please feel free to contribute new versions. This is pretty simple, instructions as below.

  1. Fork the repository, and download it.
  2. Install additional depdendency via pip install -r requirements.txt. And install flatbuffer compiler (you may need to manually build it).
  3. Generate the code for update. Tools have been prepared, there are prompt for actions.
    1. Download schema.fbs for a new version.
    2. Update the builtin operator mapping.
    3. Update the classes and functions import of submodules.
    4. Update the API document.
    5. Update the versioning in setup.py.
    6. Build and Test (simply pytest) around. Don't forget to re-install the newly built tflite package before testing it.
  4. Push your change and open Pull Request.
  5. The maintainer will take the responsibility to upload change to PyPI when merged.

Resources

License

Apache License Version 2.0 as TensorFlow's.

Disclaimer

The schema.fbs is obtained from TensorFlow directly. Maintainer of this package had tried to contact TensorFlow maintainers for licensing issues, but received no reply. Ownership or maintainship is open to transfer or close if there were any issue.

tflite's People

Contributors

lgeiger avatar zhenhuaw-me 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.