A lightweight Python package optimized for integrating exported models from Google's Teachable Machine Platform into robotics and embedded systems environments. This streamlined version of Teachable Machine Package is specifically designed for resource-constrained devices, making it easier to deploy and use your trained models in embedded applications. With a focus on efficiency and minimal dependencies, this tool maintains the core functionality while being more suitable for robotics and IoT projects.
Project description
Teachable Machine Lite
By: Meqdad Darwish
Description
A lightweight Python package optimized for integrating exported models from Google's Teachable Machine Platform into robotics and embedded systems environments. This streamlined version of Teachable Machine Package is specifically designed for resource-constrained devices, making it easier to deploy and use your trained models in embedded applications. With a focus on efficiency and minimal dependencies, this tool maintains the core functionality while being more suitable for robotics and IoT projects.
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 exported and quantized TensorFlow Lite model from Teachable Machine Platform (a model file with tflite
extension).
Requirements
Python >= 3.7
How to install Teachable Machine Lite Package
pip install teachable-machine-lite
Dependencies
numpy
tflite-runtime
Pillow
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"
image_file_name = "screenshot.jpg"
tm_model = TeachableMachineLite(model_path=model_path, labels_file_path=labels_path)
while True:
ret, img = cap.read()
cv.imwrite(image_file_name, img)
results, resultImage = tm_model.classify_and_show(image_file_name, convert_to_bgr=True)
print("results:", results)
cv.imshow("Camera", resultImage)
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; take a look on these examples
Links:
Links:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file teachable_machine_lite-1.2.0.1.tar.gz
.
File metadata
- Download URL: teachable_machine_lite-1.2.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b4f7d806f7da9f7dae8129e4225f6644e9a190cdc0ca17c3b0c4737ca4964d5 |
|
MD5 | 48fa678434b0792a3a55b9a6e6a81286 |
|
BLAKE2b-256 | 70f546b5a3258dbf9ff6246b8adee74374d7912f911cbc448ea2edf6569eed69 |
Provenance
The following attestation bundles were made for teachable_machine_lite-1.2.0.1.tar.gz
:
Publisher:
publish.yml
on MeqdadDev/teachable-machine-lite
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
teachable_machine_lite-1.2.0.1.tar.gz
- Subject digest:
1b4f7d806f7da9f7dae8129e4225f6644e9a190cdc0ca17c3b0c4737ca4964d5
- Sigstore transparency entry: 149434930
- Sigstore integration time:
- Predicate type:
File details
Details for the file teachable_machine_lite-1.2.0.1-py3-none-any.whl
.
File metadata
- Download URL: teachable_machine_lite-1.2.0.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35901f6ae9460e097c11a46ce68fb30c47879141db735048043b29b0be5d792b |
|
MD5 | 0aafadf760a21f6206485cf6e1c9f7ef |
|
BLAKE2b-256 | b55dcb59b0668671f7f574bddbfa48cb292e84c97071198ca23b43e1c24f4be8 |
Provenance
The following attestation bundles were made for teachable_machine_lite-1.2.0.1-py3-none-any.whl
:
Publisher:
publish.yml
on MeqdadDev/teachable-machine-lite
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
teachable_machine_lite-1.2.0.1-py3-none-any.whl
- Subject digest:
35901f6ae9460e097c11a46ce68fb30c47879141db735048043b29b0be5d792b
- Sigstore transparency entry: 149434932
- Sigstore integration time:
- Predicate type: