Skip to content

cm-st-project/tflite_sample_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorFlow Lite Image Classifier

This project contains a Python script that utilizes a TensorFlow Lite model to classify images. The script loads a pre-trained TFLite model, processes an input image, and outputs the classification results.

Features

  • Load a TensorFlow Lite model.
  • Process images for model input.
  • Classify images and output predictions.

Requirements

  • Python 3.6 or newer
  • TensorFlow
  • NumPy
  • Pillow (PIL)

Installation

To set up your environment to run this script, follow these steps:

  1. Ensure Python 3.6+ is installed on your system.
  2. Install the required Python packages:
pip install tensorflow numpy pillow

Usage

To use the script, you need to have a TFLite model file and a corresponding labels text file. Place your image file in the same directory as the script or specify the path to it.

Run the script using:

python main.py

Files Description

  • main.py: Main script to load the model, process the image, and classify it.
  • model_unquant1.tflite: TensorFlow Lite model file (ensure you have this file in the same directory).
  • labels.txt: Text file containing labels corresponding to the model's output.
  • perch.jpg: Example image file for testing the classifier.

Model Details

This script is configured to use a model named model_unquant1.tflite. Ensure that you replace "model_unquant1.tflite" and "labels.txt" in the script with the paths to your actual model and labels files, respectively.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages