Skip to content

Teachable Machine Lite

Teachable Machine Lite logo

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.

Get started Browse examples

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

  • 1. Train


    Train an image model in Teachable Machine, with no coding.

  • 2. Export


    Download it as a TensorFlow Lite model, quantized or floating point, with its labels.txt.

  • 3. Run


    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.

  • Built for edge computing

    Runs your model on the device itself, for robots and other low-power hardware such as Raspberry Pi.

  • Takes frames directly

    Pass OpenCV or Picamera2 frames, PIL images or file paths. No need to save frames first.

  • Plain results

    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.