Flask web app for real-time image classification using a pretrained MobileNetV2 (ImageNet weights). Upload an image, get the top class with confidence.
- Upload any image via a Bootstrap-styled web form
- Real-time classification using MobileNetV2 pretrained on ImageNet (1000 classes)
- Predicted label + confidence percentage
Flask-Image-Classifier/
├── app.py # Flask application
├── templates/
│ └── index.html # Bootstrap upload form
└── images/ # Uploaded images (auto-saved)
git clone https://github.com/Anjanamb/Flask-Image-Classifier.git
cd Flask-Image-Classifier
pip install flask tensorflow
python app.pyOpen http://127.0.0.1:3000/, upload an image, click Predict Image.
The uploaded image is resized to 224×224, preprocessed for MobileNetV2, and decoded with decode_predictions. Example output:
Labrador retriever (95.23%)
- Top-K predictions (not just top-1)
- Display the uploaded image alongside the prediction
- Dockerfile
- Fine-tuning script for custom datasets
MIT — see anjanamb.github.io for more projects.