Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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.
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
The raw API of tflite
can be found in this documentation.
The MobileNet test can serve as a usage example of parsing models.
The generated python package is not friendly to use sometimes. We have introduced several enhancements:
import tflite
(example) to replace importing every classes and funtions in tflite
(example).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.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 in 2.4.0
, see this issue.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.
pip install -r requirements.txt
. And install flatbuffer compiler (you may need to manually build it).schema.fbs
for a new version.__init__.py
.pytest
) around. Don't forget to re-install the newly built tflite
package before testing it.Apache License Version 2.0 as TensorFlow's.
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.
FAQs
Parsing TensorFlow Lite Models (*.tflite) Easily
We found that tflite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.