Skip to main content

A very basic and easy to use module for images classification. Works on any Mac OS, Windows and Linux but is intended to be used on Raspberry Pi or similar edge device

Project description

Usage: noahs_image_classifier

This library provides a simple and easy way to do image classification using a tensorflow lite model built using the Google Teachable Machine. This is intended to be used with relatively small models on low performance machines such as a Raspberry pi or a personal laptop.

Getting Started

First build a Standard Image Model using the Google Teachable Machine. Link to Google Teachable Machine

You After training your model, export it as a Tensorflow Lite model. This should give you a zip file containing a model and labels file.

Once you have a model.tflite and labels.txt file extracted from the .zip file, place them in a directory where you want to run your Python script and pip install the library.

pip install noahs_image_classifier

You will now need to get some sample .jpg images and put them in the same directory as your model files in order to test the .classify() method.

However, you can also just use whatever camera is connected to your machine to classify whatever is in view using the .capture_and_identify() method.

Below is some sample code of what these would look like.

from noahs_image_classifier import image_classifier

model = image_classifier(model_path="model.tflite", class_names="labels.txt")

# if you already have test images downloaded, do this ...
c1 = model.classify("test_image1.jpg")
print("\n")
print(c1)
print("\n")


# if you want to classify whatever is in front of your computer's camera, do this ...
c2 = model.capture_and_identify()
print("\n")
print(c2)
print("\n")

Your Directory strucuture should looks something like this before running the code above...

your_project_directory/
│
├── model.tflite
├── labels.txt
├── test_image1.jpg
├── your_script.py

Check out Source Code

https://github.com/jonesnoah45010/image_classifier

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

noahs_image_classifier-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noahs_image_classifier-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file noahs_image_classifier-0.1.0.tar.gz.

File metadata

  • Download URL: noahs_image_classifier-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for noahs_image_classifier-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a78e0de294c247618539241af712b407f851b48cafa28573ca3234f071cae40b
MD5 041e6739863b000be2c622de9407b91c
BLAKE2b-256 8d22f5d5a2d1131d4270c0c1a192e033392f6ed97efa70ace2873c6961fd0a09

See more details on using hashes here.

File details

Details for the file noahs_image_classifier-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for noahs_image_classifier-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39e94861b610fb77498ef3b441b4aeb0f9c3c9e50bddc59afaa25f5c1849f924
MD5 a78422ea7a66cfda72e284d9bf2f819b
BLAKE2b-256 4d8a51683c336a2e87261cb3d8a212a9da5336e249c72a261291ea075dad667f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page