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 yzlite.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

yzlite.core.TfliteModel

Class to access a .tflite model flatbuffer's layers and tensors

yzlite.core.TfliteLayer

Wrapper for TFLite flatbuffer layer

yzlite.core.TfliteAddLayer

ADD operation TfliteLayer

yzlite.core.TfliteConv2dLayer

CONV_2D operation TfliteLayer

yzlite.core.TfliteConv2DLayerOptions

Convolution layer options

yzlite.core.TfliteConvParams

Calculated Convolution Parameters

yzlite.core.TfliteTransposeConvLayer

TRANSPOSE_CONV operation TfliteLayer

yzlite.core.TfliteTransposeConvLayerOptions

Transpose convolution layer options

yzlite.core.TfliteTransposeConvParams

Calculated Transpose Convolution Parameters

yzlite.core.TfliteFullyConnectedLayer

FULLY_CONNECT operation TfliteLayer

yzlite.core.TfliteFullyConnectedLayerOptions

Fully connection layer options

yzlite.core.TfliteFullyConnectedParams

Calculated Full Connected Parameters

yzlite.core.TfliteDepthwiseConv2dLayer

DEPTHWISE_CONV_2D operation TfliteLayer

yzlite.core.TfliteDepthwiseConv2DLayerOptions

Depthwise Convolution options

yzlite.core.TfliteDepthwiseConvParams

Calculated Depthwise Convolution Parameters

yzlite.core.TflitePooling2dLayer

AVERAGE_POOL_2D or MAX_POOL_2D operation TfliteLayer

yzlite.core.TflitePool2DLayerOptions

Pooling layer options

yzlite.core.TflitePoolParams

Calculated Pooling Parameters

yzlite.core.TfliteReshapeLayer

RESHAPE operation TfliteLayer

yzlite.core.TfliteQuantizeLayer

QUANTIZE operation TfliteLayer

yzlite.core.TfliteDequantizeLayer

DEQUANTIZE operation TfliteLayer

yzlite.core.TfliteTensor

Wrapper for TFLite flatbuffer tensor

yzlite.core.TfliteShape

Wrapper for tensor shape.

yzlite.core.TfliteQuantization

Wrapper for tensor quantization

yzlite.core.TfliteActivation

Activation types

yzlite.core.TflitePadding

Padding types

yzlite.core.TfliteModelParameters

.tflite Model Parameters