This is a Streamlit web app that integrates MobileNetV2 and a CIFAR-10 model for image classification. Users can upload images and receive predictions with confidence scores from either model. It features a sleek navigation bar for easy switching and real-time results, which is ideal for learning and practical use.
π Live App: Streamlit Cloud Deployment (See deployment section)

-
Dual Model Support:
- MobileNetV2 (ImageNet): Recognizes 1,000+ different classes - animals, vehicles, objects, etc.
- Custom CIFAR-10 Model: Classifies into 10 specific categories - airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck.
-
Intuitive Interface:
- Navigation Bar: Seamlessly switch between models using sidebar menu
- Real-Time Classification: Upload images and get instant predictions with confidence scores
- Beautiful UI: Progress bars, formatted results, responsive design
-
Educational & Practical:
- Learn about deep learning models and their performance
- Practical image classification for real-world applications
- Fully open-source and customizable
- Python 3.10+ (Recommended: 3.11 for best compatibility)
- Git (for version control)
- Web Browser (Chrome, Firefox, Safari, Edge)
- ~2GB disk space (for dependencies and models)
-
Clone the repository:
git clone https://github.com/vivek-kumar-P/Image-Classification-model cd Image-Classification-model -
Create virtual environment (Python 3.11 recommended):
python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Run the app:
streamlit run app.py
-
Access the app: Opens automatically at
http://localhost:8501
# Navigate to project
cd "e:\code better\Image-Classification-model"
# Activate venv
.\venv\Scripts\Activate.ps1
# Install requirements
pip install -r requirements.txt
# Run app
streamlit run app.py-
Select a Model:
- Use the sidebar to choose between MobileNetV2 or CIFAR-10
-
Upload an Image:
- Click "Choose an image..." and select JPG/PNG file
- Supported formats: JPEG, PNG, JPG
- Max file size: 200MB
-
View Predictions:
- Real-time classification results
- Top predictions with confidence scores
- Progress bars showing confidence levels
Error: ERROR: Could not find a version that satisfies the requirement tensorflow
Cause: TensorFlow 2.15+ requires Python 3.10-3.13. Python 3.14+ not yet supported.
Solution:
# Check Python version
python --version
# If Python 3.14+, use Python 3.11 instead
# Create new venv with Python 3.11
python3.11 -m venv venv
venv\Scripts\activate
pip install -r requirements.txtError: OSError: [WinError 126] The specified module could not be found
Cause: TensorFlow needs Microsoft Visual C++ runtime libraries.
Solution:
1. Download: https://aka.ms/vs/17/release/vc_redist.x64.exe
2. Run the installer (admin mode)
3. Restart your terminal/IDE
4. Reinstall TensorFlow: pip install tensorflow
Error: Port 8501 is already in use
Cause: Another Streamlit app is running on the same port.
Solution:
# Use a different port
streamlit run app.py --server.port 8502
# Or kill existing process (Windows):
netstat -ano | findstr :8501
taskkill /PID <PID> /FError: error: subprocess-exited-with-error with numpy version conflict
Cause: Incompatible version pinning in requirements.txt
Solution:
# Clear pip cache
pip cache purge
# Upgrade pip
pip install --upgrade pip
# Reinstall with fresh environment
pip install -r requirements.txt --no-cache-dirError: TensorFlow installation fails on Streamlit Cloud
Cause: Streamlit Cloud trying to install with wrong Python version
Solution:
1. Delete the app from Streamlit Cloud
2. Redeploy and select Python 3.11 in Advanced Settings
3. Click Deploy
-
Push code to GitHub:
git add . git commit -m "Your message" git push origin main
-
Go to Streamlit Cloud:
- Visit https://share.streamlit.io
- Sign in with GitHub
-
Deploy New App:
- Click "New app"
- Select repository:
vivek-kumar-P/Image-Classification-model - Branch:
main - Main file:
app.py
-
Configure Python Version (IMPORTANT):
- Click "Advanced settings"
- Select Python 3.11 from dropdown
- Click "Deploy"
-
Wait for deployment (2-3 minutes):
- App will be live at:
https://your-username-image-classification.streamlit.app
- App will be live at:
Build fails with TensorFlow error?
- Delete app β Redeploy with Python 3.11 selected
Port/Process errors?
- Streamlit Cloud handles this automatically, just redeploy
Dependencies not installing?
- Update requirements.txt with compatible versions
- Commit β Push β Redeploy
Your Computer
ββ Python 3.11
ββ Virtual Environment
ββ Dependencies (from requirements.txt)
ββ App code (app.py)
ββ Models (cifar10_model.h5)
ββ Runs on localhost:8501
Streamlit's Servers
ββ Python 3.11 (selected during deploy)
ββ Virtual Environment (auto-created)
ββ Dependencies (installed from requirements.txt)
ββ Your code (cloned from GitHub)
ββ Runs 24/7 at streamlit.app URL
Key Point: Cloud app is independent from local setup! Deleting local files won't affect the live app.
Image-Classification-model/
βββ app.py # Main Streamlit application
βββ train.py # Model training script
βββ cifar10_model.h5 # Pre-trained CIFAR-10 model
βββ requirements.txt # Python dependencies
βββ README.md # Documentation (this file)
βββ .streamlit/
β βββ config.toml # Streamlit Cloud config
βββ Testing Images/
βββ CIFAR-10/ # Test images
βββ MobileNetV2/ # Test images
β
Fixed dependency conflicts in requirements.txt
β
Added flexible version constraints instead of strict pinning
β
Added .streamlit/config.toml for Cloud deployment
β
Updated app.py with better error handling
β
Tested on Python 3.11 with TensorFlow 2.15.0
β
Verified Streamlit Cloud deployment
- TensorFlow not available for Python 3.14 β Switched to Python 3.11
- Dependency version conflicts β Updated requirements.txt with compatible versions
- Missing Visual C++ libraries β Provided download and install instructions
- Port conflicts on local β Added port configuration examples
- Streamlit Cloud deployment failures β Added Python version selection guide
| Problem | Command | Status |
|---|---|---|
| Wrong Python version | python --version |
Check output |
| venv not activating | venv\Scripts\activate.ps1 |
PowerShell |
| Dependencies failing | pip install --upgrade pip |
Then reinstall |
| App not starting | streamlit run app.py --logger.level=error |
Debug mode |
| Port in use | streamlit run app.py --server.port 8502 |
Alt port |
| TensorFlow error | Use Python 3.11 | Fallback version |
- Classes: 1,000+
- Input: 224Γ224 RGB images
- Performance: Fast, mobile-friendly
- Use case: General object detection
- Classes: 10 (airplane, car, bird, cat, deer, dog, frog, horse, ship, truck)
- Input: 32Γ32 RGB images
- Performance: Specialized classification
- Use case: Specific object detection in 10 categories
- Add image download with predictions
- Add batch image processing
- Deploy custom model training interface
- Add prediction history
- Mobile app version
- Real-time webcam classification
This project is open-source and available for educational and commercial use.
Feel free to:
- Fork the repository
- Create issues for bugs/features
- Submit pull requests
- Share feedback and improvements
- Streamlit - Web app framework
- TensorFlow - Deep learning library
- Keras - Neural network API
- MobileNetV2 - Pre-trained model
- CIFAR-10 Dataset - Training data
For issues or questions:
- Check the Troubleshooting section above
- Review Known Issues & Solutions
- Open an issue on GitHub
- Contact the maintainer
Last Updated: January 28, 2026 Status: β Production Ready for Streamlit Cloud