Skip to main content

Teachable Machine Lite

By: Meqdad Darwish

Teachable Machine Lite Package Logo

Downloads MIT License PyPI Tests

Description

Run your Google Teachable Machine image models on Raspberry Pi, robots and other edge devices in a few lines of Python. Lightweight, powered by LiteRT, no TensorFlow required.

Teachable Machine Lite lets you take an image model you trained in Google's Teachable Machine, with no coding needed, and run it on a Raspberry Pi, a robot, or any small computer with just a few lines of Python. It runs on LiteRT (formerly TensorFlow Lite) instead of the full TensorFlow, so it installs quickly, starts fast and works comfortably on resource-constrained hardware. Pass it a camera frame from OpenCV or Picamera2 and get back the predicted class and its confidence, ready to draw on the image or act on. That makes it a good fit for robotics, IoT and other edge AI projects. It's the lightweight sibling of the Teachable Machine package.

Source Code is published on GitHub

Read more about the project (requirements, installation, examples and more) in the Documentation Website

Supported Classifiers

Image Classification: Use an exported TensorFlow Lite model from Teachable Machine Platform (a model file with tflite extension). Both the Quantized and the Floating point exports are supported.

Requirements

For detailed information about package requirements and supported platforms, please visit our documentation

Python >= 3.9

Works with NumPy 1.x and 2.x. On Raspberry Pi, use the 64-bit Raspberry Pi OS.

How to install Teachable Machine Lite Package

pip install teachable-machine-lite

On Raspberry Pi OS, install inside a virtual environment; see the installation guide.

Dependencies

numpy
Pillow
ai-edge-litert   # LiteRT (TensorFlow Lite); tflite-runtime on 32-bit Raspberry Pi OS

Example

An example for teachable machine lite package with OpenCV:

from teachable_machine_lite import TeachableMachineLite
import cv2 as cv

cap = cv.VideoCapture(0)

model_path = "model.tflite"
labels_path = "labels.txt"

tm_model = TeachableMachineLite(model_path=model_path, labels_file_path=labels_path)

while True:
    ret, frame = cap.read()
    if not ret:
        break

    results, result_image = tm_model.classify_and_show(frame)
    print("results:", results)

    cv.imshow("Camera", result_image)
    k = cv.waitKey(1)
    if k == 27:  # Press ESC to close the camera view
        break

cap.release()
cv.destroyAllWindows()

Values of results are assigned based on the content of labels.txt file.

For more, including the Raspberry Pi camera module (Picamera2), take a look at these examples

Metadata

Release files for teachable-machine-lite 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teachable-machine-lite 1.3.0
File Size Uploaded Provenance Actions
teachable_machine_lite-1.3.0.tar.gz 11.0 kB With provenance Details for teachable_machine_lite-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for teachable-machine-lite 1.3.0
File Interpreter ABI Platform Actions
teachable_machine_lite-1.3.0-py3-none-any.whl Python 3 none any Details for teachable_machine_lite-1.3.0-py3-none-any.whl

Total release size: 19.8 kB

Release files / teachable_machine_lite-1.3.0.tar.gz

Download URL teachable_machine_lite-1.3.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
740545ac1bd1a097dd2e8033685a45292e9b81c3e94c88c2e224865730f66c3f
BLAKE2b-256 checksum
How to use checksums
32189717f54d62e05ab8b5f9cc195f42d647c804c64b16432285700592fbccbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / teachable_machine_lite-1.3.0-py3-none-any.whl

Download URL teachable_machine_lite-1.3.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4f5448dd2b5e670db4d254a5319e44f8911509901520bd0900370b014ef119f
BLAKE2b-256 checksum
How to use checksums
d68f82eabb770dbda9cd2a82281d717ddda2fd7703c8543c8d49b3ceb75bc60a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for teachable-machine-lite 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for teachable_machine_lite-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page