Skip to content

A simple Flask web app for real-time image classification using a pretrained MobileNetV2 deep learning model (ImageNet weights).

License

Notifications You must be signed in to change notification settings

Anjanamb/Flask-Image-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-Image-Classifier

A simple Flask web app for real-time image classification using a pretrained MobileNetV2 deep learning model (ImageNet weights).

Users can upload an image through the web interface, and the app predicts the most likely class with confidence.


Features

  • Upload any image via the web interface
  • Real-time classification using MobileNetV2
  • Displays predicted label with confidence percentage
  • Web UI styled with Bootstrap
  • Easy to run locally

Project Structure

Flask-Image-Classifier/
├── app.py # Flask application
├── templates/
│ └── index.html # Frontend (Bootstrap upload form)
└── images/ # Uploaded images (auto-saved here)

Requirements

  • Python 3.8+
  • Install dependencies:
    pip install flask tensorflow
    

Usage

1. Clone the repo

git clone https://github.com/Anjanamb/Flask-Image-Classifier.git
cd Flask-Image-Classifier

2. Run the Flask app

python app.py

3. Open in browser

http://127.0.0.1:3000/

4. Upload an image

  • Select an image file.
  • Click Predict Image.
  • The prediction and confidence will be displayed.

Model Details

  • Uses MobileNetV2 pretrained on ImageNet (1000 classes).
  • Image is resized to 224x224, preprocessed, and fed to the model.
  • Output is decoded using decode_predictions.

Example prediction output:

Labrador retriever (95.23%)

Future Improvements

  • Support for multiple top predictions
  • Display uploaded image alongside prediction
  • Add Docker support for easier deployment
  • Deploy on cloud (Heroku, AWS, etc.)
  • Option to fine-tune MobileNetV2 with custom dataset

License

This project is licensed under the MIT License. See the LICENSE file for details.


About

A simple Flask web app for real-time image classification using a pretrained MobileNetV2 deep learning model (ImageNet weights).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published