Teachable Machine Lite¶

Run your Google Teachable Machine image models on Raspberry Pi, robots and other edge devices. A few lines of Python, powered by LiteRT, with no TensorFlow required.
pip install teachable-machine-lite
from teachable_machine_lite import TeachableMachineLite
model = TeachableMachineLite(model_path="model.tflite", labels_file_path="labels.txt")
result = model.classify_image("photo.jpg")
print(result["label"], result["confidence"])
From idea to device¶
-
Train an image model in Teachable Machine, with no coding.
-
Download it as a TensorFlow Lite model, quantized or floating point, with its
labels.txt. -
Pass it a camera frame or an image file and get back the class and its confidence.
Why Teachable Machine Lite¶
-
Lightweight
Runs on LiteRT (formerly TensorFlow Lite) instead of the full TensorFlow.
-
Runs your model on the device itself, for robots and other low-power hardware such as Raspberry Pi.
-
Pass OpenCV or Picamera2 frames, PIL images or file paths. No need to save frames first.
-
Results are ordinary Python values, so you can compare them, log them or send them as JSON.
Need to use a Keras .h5 model?
Use the Teachable Machine package, which runs on the full TensorFlow.