teachable-machine-lite


Nameteachable-machine-lite JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/MeqdadDev/teachable-machine-lite
SummaryA Python package to simplify the deployment process of exported
upload_time2023-04-05 11:12:31
maintainer
docs_urlNone
authorMeqdad Dev
requires_python
license
keywords python teachable machine ai computer vision camera opencv image classification tensorflowlite raspberry pi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Teachable Machine Lite

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
[![Downloads](https://static.pepy.tech/badge/teachable-machine-lite)](https://pepy.tech/project/teachable-machine-lite)
[![PyPI](https://img.shields.io/pypi/v/teachable-machine-lite)](https://pypi.org/project/teachable-machine-lite/)

## Description

A Python package to simplify the deployment process of exported [Teachable Machine](https://teachablemachine.withgoogle.com/) models into different Robotics, AI and IoT controllers such as: Raspberry Pi, Jetson Nano and any other SBCs using TensorFlowLite framework.

Developed by [@MeqdadDev](https://www.github.com/MeqdadDev)

## Supported Classifiers

**Image Classification**: use exported and quantized TensorFlow Lite model from [Teachable Machine platfrom](https://teachablemachine.withgoogle.com/) (a model file with `tflite` extension).


## Requirements

```
Python >= 3.7
```

## How to install package

```bash
pip install teachable-machine-lite
```

## Dependencies

```bash
numpy
tflite-runtime
Pillow (PIL)
```

## How to Use Teachable Machine Lite Package

```python
from teachable_machine_lite import TeachableMachineLite
import cv2 as cv

cap = cv.VideoCapture(0)

model_path = 'model.tflite'
image_file_name = "frame.jpg"
labels_path = "labels.txt"

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

while True:
    ret, frame = cap.read()
    cv.imshow('Cam', frame)
    cv.imwrite(image_file_name, frame)
    
    results = tm_model.classify_frame(image_file_name)
    print("results:",results)
    
    k = cv.waitKey(1)
    if k% 255 == 27:
        # press ESC to close camera view.
        break
```

## Links:

[PyPI](https://pypi.org/project/teachable-machine-lite/)

[Source Code](https://github.com/MeqdadDev/teachable-machine-lite)

[Developer](https://github.com/MeqdadDev)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MeqdadDev/teachable-machine-lite",
    "name": "teachable-machine-lite",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,teachable machine,ai,computer vision,camera,opencv,image classification,tensorflowlite,raspberry pi",
    "author": "Meqdad Dev",
    "author_email": "meqdad.darweesh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0a/bc/4612ce5e0a3cce31b6b93c5e0cc660a85613e052a505f91ced0738cb13b6/teachable-machine-lite-1.1.tar.gz",
    "platform": null,
    "description": "# Teachable Machine Lite\r\n\r\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\r\n[![Downloads](https://static.pepy.tech/badge/teachable-machine-lite)](https://pepy.tech/project/teachable-machine-lite)\r\n[![PyPI](https://img.shields.io/pypi/v/teachable-machine-lite)](https://pypi.org/project/teachable-machine-lite/)\r\n\r\n## Description\r\n\r\nA Python package to simplify the deployment process of exported [Teachable Machine](https://teachablemachine.withgoogle.com/) models into different Robotics, AI and IoT controllers such as: Raspberry Pi, Jetson Nano and any other SBCs using TensorFlowLite framework.\r\n\r\nDeveloped by [@MeqdadDev](https://www.github.com/MeqdadDev)\r\n\r\n## Supported Classifiers\r\n\r\n**Image Classification**: use exported and quantized TensorFlow Lite model from [Teachable Machine platfrom](https://teachablemachine.withgoogle.com/) (a model file with `tflite` extension).\r\n\r\n\r\n## Requirements\r\n\r\n```\r\nPython >= 3.7\r\n```\r\n\r\n## How to install package\r\n\r\n```bash\r\npip install teachable-machine-lite\r\n```\r\n\r\n## Dependencies\r\n\r\n```bash\r\nnumpy\r\ntflite-runtime\r\nPillow (PIL)\r\n```\r\n\r\n## How to Use Teachable Machine Lite Package\r\n\r\n```python\r\nfrom teachable_machine_lite import TeachableMachineLite\r\nimport cv2 as cv\r\n\r\ncap = cv.VideoCapture(0)\r\n\r\nmodel_path = 'model.tflite'\r\nimage_file_name = \"frame.jpg\"\r\nlabels_path = \"labels.txt\"\r\n\r\ntm_model = TeachableMachineLite(model_path=model_path, labels_file_path=labels_path)\r\n\r\nwhile True:\r\n    ret, frame = cap.read()\r\n    cv.imshow('Cam', frame)\r\n    cv.imwrite(image_file_name, frame)\r\n    \r\n    results = tm_model.classify_frame(image_file_name)\r\n    print(\"results:\",results)\r\n    \r\n    k = cv.waitKey(1)\r\n    if k% 255 == 27:\r\n        # press ESC to close camera view.\r\n        break\r\n```\r\n\r\n## Links:\r\n\r\n[PyPI](https://pypi.org/project/teachable-machine-lite/)\r\n\r\n[Source Code](https://github.com/MeqdadDev/teachable-machine-lite)\r\n\r\n[Developer](https://github.com/MeqdadDev)\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python package to simplify the deployment process of exported",
    "version": "1.1",
    "split_keywords": [
        "python",
        "teachable machine",
        "ai",
        "computer vision",
        "camera",
        "opencv",
        "image classification",
        "tensorflowlite",
        "raspberry pi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec53442371c2bd684494ffa9edfcfbed6394ff29346c00dcc41b704b6be5b7be",
                "md5": "3a3f4bb52a00371a4e7c91ac802ff0d2",
                "sha256": "9103042f245a7661e54ec12ba07fb870c026a10cd5d4f08d701177b54a614ced"
            },
            "downloads": -1,
            "filename": "teachable_machine_lite-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a3f4bb52a00371a4e7c91ac802ff0d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5147,
            "upload_time": "2023-04-05T11:12:29",
            "upload_time_iso_8601": "2023-04-05T11:12:29.498697Z",
            "url": "https://files.pythonhosted.org/packages/ec/53/442371c2bd684494ffa9edfcfbed6394ff29346c00dcc41b704b6be5b7be/teachable_machine_lite-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0abc4612ce5e0a3cce31b6b93c5e0cc660a85613e052a505f91ced0738cb13b6",
                "md5": "fb3b520283e23ade125ab0edf3363987",
                "sha256": "8ea5d14e462b695c59d49093326db3323c9eb3299d03a531030ed4e6db75613d"
            },
            "downloads": -1,
            "filename": "teachable-machine-lite-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fb3b520283e23ade125ab0edf3363987",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4972,
            "upload_time": "2023-04-05T11:12:31",
            "upload_time_iso_8601": "2023-04-05T11:12:31.200246Z",
            "url": "https://files.pythonhosted.org/packages/0a/bc/4612ce5e0a3cce31b6b93c5e0cc660a85613e052a505f91ced0738cb13b6/teachable-machine-lite-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-05 11:12:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "MeqdadDev",
    "github_project": "teachable-machine-lite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "teachable-machine-lite"
}
        
Elapsed time: 0.06819s