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.
- 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
Flask-Image-Classifier/
├── app.py # Flask application
├── templates/
│ └── index.html # Frontend (Bootstrap upload form)
└── images/ # Uploaded images (auto-saved here)
- Python 3.8+
- Install dependencies:
pip install flask tensorflow
git clone https://github.com/Anjanamb/Flask-Image-Classifier.git
cd Flask-Image-Classifierpython app.pyhttp://127.0.0.1:3000/- Select an image file.
- Click Predict Image.
- The prediction and confidence will be displayed.
- 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%)- 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
This project is licensed under the MIT License. See the LICENSE file for details.