tflite
Parse TFLite models (*.tflite) EASILY with Python. Check the API at https://zhenhuaw.me/tflite/docs/
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.9%) to scientific vocabulary
Keywords
Repository
Parse TFLite models (*.tflite) EASILY with Python. Check the API at https://zhenhuaw.me/tflite/docs/
Basic Info
- Host: GitHub
- Owner: zhenhuaw-me
- License: apache-2.0
- Language: Python
- Default Branch: master
- Homepage: https://zhenhuaw.me/tflite
- Size: 15.8 MB
Statistics
- Stars: 102
- Watchers: 3
- Forks: 23
- Open Issues: 3
- Releases: 4
Topics
Metadata Files
README.md
Easily Parse TFLite Models with Python
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.
sh
pip install tensorflow==2.3.0
pip install tflite==2.3.0
The raw API of tflite can be found in this documentation.
The MobileNet test can serve as a usage example of parsing models.
Enhancements
The generated python package is not friendly to use sometimes. We have introduced several enhancements:
- Easy import: A single
import tflite(example) to replace importing every classes and funtions intflite(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.
tflite.opcode2name(): get the type name of given opcode.tflite.BUILTIN_OPCODE2NAME: a dict that maps the opcode to name of all the builtin operators.
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.
tflite.OperatorCode.BuiltinCode(): maintains API compability in2.4.0, see this issue.
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.
- Fork the repository, and download it.
- Install additional depdendency via
pip install -r requirements.txt. And install flatbuffer compiler (you may need to manually build it). - Generate the code for update. Tools have been prepared, there are prompt for actions.
- Download
schema.fbsfor a new version. - Update the builtin operator mapping.
- Update the classes and functions import of submodules.
- Update the API document.
- Update the versioning in
__init__.py. - Build and test (simply
pytest) around. Don't forget to re-install the newly builttflitepackage before testing it.
- Download
- Push your change and open Pull Request.
- 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.
Owner
- Name: Zhenhua WANG (王振华)
- Login: zhenhuaw-me
- Kind: user
- Company: @Nvidia
- Website: https://zhenhuaw.me
- Repositories: 4
- Profile: https://github.com/zhenhuaw-me
A b[i|y]te of ML.sys|Arch|VM.
GitHub Events
Total
- Release event: 1
- Watch event: 3
- Issue comment event: 6
- Push event: 1
- Pull request event: 2
- Fork event: 2
- Create event: 1
Last Year
- Release event: 1
- Watch event: 3
- Issue comment event: 6
- Push event: 1
- Pull request event: 2
- Fork event: 2
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| 王振华 (Zhenhua WANG) | i@j****t | 118 |
| ebraheemabbas | 5****s | 1 |
| Thibaut Vercueil | t****v@g****m | 1 |
| Lukas Geiger | l****4@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 13
- Total pull requests: 7
- Average time to close issues: about 2 months
- Average time to close pull requests: 12 days
- Total issue authors: 11
- Total pull request authors: 5
- Average comments per issue: 1.23
- Average comments per pull request: 2.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 18 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 5.5
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- zhenhuaw-me (3)
- sjzhuo (1)
- surajpandey353 (1)
- CzakoZoltan08 (1)
- korabelnikov (1)
- bmabir17 (1)
- ed-mr (1)
- handsomeRobot (1)
- badenh (1)
- leaf918 (1)
- vipcxj (1)
- hhloz (1)
Pull Request Authors
- ebraheemabbas (2)
- zhenhuaw-me (2)
- janjongboom (1)
- lgeiger (1)
- thibthibaut (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 64,247 last-month
- Total docker downloads: 715
- Total dependent packages: 22
- Total dependent repositories: 168
- Total versions: 18
- Total maintainers: 2
- Total advisories: 1
pypi.org: tflite
Parsing TensorFlow Lite Models (*.tflite) Easily
- Homepage: https://zhenhuaw.me/tflite
- Documentation: https://tflite.readthedocs.io/
- License: Apache License 2.0
-
Latest release: 2.18.0
published over 1 year ago
Rankings
Advisories (1)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/stale v3 composite
- GitPython *
- build *
- flatbuffers *
- numpy *
- pdoc3 *
- pytest *
- twine *