Tensorflow-Lite Model¶
This allows for accessing .tflite model files.
A .tflite
uses a binary format called a flatbuffer.
The flatbuffer “schema” used by a .tflite
model is defined in schema.fbs.
Example Usage¶
Example usage of this package is as follows:
# Import the TfliteModel class
from mltk.core import TfliteModel
# Load the .tflite
tflite_model = TfliteModel.load_flatbuffer_file(tflite_path)
# Generate a summary of the .tflite
summary = tflite_model.summary()
# Print the summary to the console
print(summary)
See the TfliteModel API examples for more examples.
API Reference¶
Class to access a .tflite model flatbuffer's layers and tensors |
Wrapper for TFLite flatbuffer layer |
ADD operation TfliteLayer |
CONV_2D operation TfliteLayer |
Convolution layer options |
Calculated Convolution Parameters |
TRANSPOSE_CONV operation TfliteLayer |
Transpose convolution layer options |
Calculated Transpose Convolution Parameters |
FULLY_CONNECT operation TfliteLayer |
Fully connection layer options |
Calculated Full Connected Parameters |
DEPTHWISE_CONV_2D operation TfliteLayer |
Depthwise Convolution options |
Calculated Depthwise Convolution Parameters |
AVERAGE_POOL_2D or MAX_POOL_2D operation TfliteLayer |
Pooling layer options |
Calculated Pooling Parameters |
RESHAPE operation TfliteLayer |
QUANTIZE operation TfliteLayer |
DEQUANTIZE operation TfliteLayer |
UNIDIRECTIONAL_SEQUENCE_LSTM operation TfliteLayer |
Fully connection layer options |
Wrapper for TFLite flatbuffer tensor |
Wrapper for tensor shape. |
Wrapper for tensor quantization |
Activation types |
Padding types |
.tflite Model Parameters |