Skip to main content

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

Release files for noahs-image-classifier 0.1.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 noahs-image-classifier 0.1.0
File Size Uploaded
noahs_image_classifier-0.1.0.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for noahs-image-classifier 0.1.0
File Interpreter ABI Platform
noahs_image_classifier-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / noahs_image_classifier-0.1.0.tar.gz

Download URL noahs_image_classifier-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a78e0de294c247618539241af712b407f851b48cafa28573ca3234f071cae40b
BLAKE2b-256 checksum
How to use checksums
8d22f5d5a2d1131d4270c0c1a192e033392f6ed97efa70ace2873c6961fd0a09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / noahs_image_classifier-0.1.0-py3-none-any.whl

Download URL noahs_image_classifier-0.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39e94861b610fb77498ef3b441b4aeb0f9c3c9e50bddc59afaa25f5c1849f924
BLAKE2b-256 checksum
How to use checksums
4d8a51683c336a2e87261cb3d8a212a9da5336e249c72a261291ea075dad667f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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