{"id":23084737,"url":"https://github.com/vivek-kumar-p/image-classification-model","last_synced_at":"2026-05-09T09:54:40.587Z","repository":{"id":267139644,"uuid":"900323609","full_name":"vivek-kumar-P/Image-Classification-model","owner":"vivek-kumar-P","description":"Image-Classification-model is a Streamlit 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, ideal for both learning and practical use.","archived":false,"fork":false,"pushed_at":"2024-12-16T13:31:24.000Z","size":17445,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T15:13:00.362Z","etag":null,"topics":["cifar10","image-classification","machine-learning","python","streamlit","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vivek-kumar-P.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T13:42:50.000Z","updated_at":"2024-12-16T13:33:30.000Z","dependencies_parsed_at":"2024-12-08T16:33:54.912Z","dependency_job_id":"712f8bba-1d99-408f-b48e-497c60c4f16c","html_url":"https://github.com/vivek-kumar-P/Image-Classification-model","commit_stats":null,"previous_names":["vivek-kumar-p/image-classification-model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivek-kumar-P%2FImage-Classification-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivek-kumar-P%2FImage-Classification-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivek-kumar-P%2FImage-Classification-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivek-kumar-P%2FImage-Classification-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivek-kumar-P","download_url":"https://codeload.github.com/vivek-kumar-P/Image-Classification-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247024151,"owners_count":20870940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cifar10","image-classification","machine-learning","python","streamlit","tensorflow"],"created_at":"2024-12-16T16:43:26.253Z","updated_at":"2026-05-09T09:54:40.582Z","avatar_url":"https://github.com/vivek-kumar-P.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 Image Classification Model\n\nThis 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.\n\n**🌐 Live App:** [Streamlit Cloud Deployment](https://share.streamlit.io) (See deployment section)\n\u003cimg width=\"1908\" height=\"751\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a5c63348-345e-4757-ae46-119b5fdd024a\" /\u003e\n\n\n## 🎯 Key Features\n\n- **Dual Model Support**:\n  - **MobileNetV2 (ImageNet)**: Recognizes **1,000+ different classes** - animals, vehicles, objects, etc.\n  - **Custom CIFAR-10 Model**: Classifies into **10 specific categories** - airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck.\n\n- **Intuitive Interface**:\n  - **Navigation Bar**: Seamlessly switch between models using sidebar menu\n  - **Real-Time Classification**: Upload images and get instant predictions with confidence scores\n  - **Beautiful UI**: Progress bars, formatted results, responsive design\n\n- **Educational \u0026 Practical**:\n  - Learn about deep learning models and their performance\n  - Practical image classification for real-world applications\n  - Fully open-source and customizable\n\n## 📋 Prerequisites\n\n- **Python 3.10+** (Recommended: 3.11 for best compatibility)\n- **Git** (for version control)\n- **Web Browser** (Chrome, Firefox, Safari, Edge)\n- **~2GB disk space** (for dependencies and models)\n\n## 🚀 Installation \u0026 Setup\n\n### Quick Start (Local Development)\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/vivek-kumar-P/Image-Classification-model\n   cd Image-Classification-model\n   ```\n\n2. **Create virtual environment** (Python 3.11 recommended):\n   ```bash\n   python -m venv venv\n   \n   # On Windows:\n   venv\\Scripts\\activate\n   \n   # On macOS/Linux:\n   source venv/bin/activate\n   ```\n\n3. **Install dependencies**:\n   ```bash\n   pip install --upgrade pip\n   pip install -r requirements.txt\n   ```\n\n4. **Run the app**:\n   ```bash\n   streamlit run app.py\n   ```\n\n5. **Access the app**:\n   Opens automatically at `http://localhost:8501`\n\n### Windows Installation (Step-by-Step)\n\n```powershell\n# Navigate to project\ncd \"e:\\code better\\Image-Classification-model\"\n\n# Activate venv\n.\\venv\\Scripts\\Activate.ps1\n\n# Install requirements\npip install -r requirements.txt\n\n# Run app\nstreamlit run app.py\n```\n\n\n### Usage\n\n1. **Select a Model**:\n   - Use the sidebar to choose between **MobileNetV2** or **CIFAR-10**\n\n2. **Upload an Image**:\n   - Click \"Choose an image...\" and select JPG/PNG file\n   - Supported formats: JPEG, PNG, JPG\n   - Max file size: 200MB\n\n3. **View Predictions**:\n   - Real-time classification results\n   - Top predictions with confidence scores\n   - Progress bars showing confidence levels\n\n---\n\n## 🐛 Known Issues \u0026 Solutions\n\n### Issue 1: TensorFlow Installation Error\n**Error:** `ERROR: Could not find a version that satisfies the requirement tensorflow`\n\n**Cause:** TensorFlow 2.15+ requires Python 3.10-3.13. Python 3.14+ not yet supported.\n\n**Solution:**\n```bash\n# Check Python version\npython --version\n\n# If Python 3.14+, use Python 3.11 instead\n# Create new venv with Python 3.11\npython3.11 -m venv venv\nvenv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n### Issue 2: Missing Visual C++ Redistributable\n**Error:** `OSError: [WinError 126] The specified module could not be found`\n\n**Cause:** TensorFlow needs Microsoft Visual C++ runtime libraries.\n\n**Solution:**\n```\n1. Download: https://aka.ms/vs/17/release/vc_redist.x64.exe\n2. Run the installer (admin mode)\n3. Restart your terminal/IDE\n4. Reinstall TensorFlow: pip install tensorflow\n```\n\n### Issue 3: Port Already in Use\n**Error:** `Port 8501 is already in use`\n\n**Cause:** Another Streamlit app is running on the same port.\n\n**Solution:**\n```bash\n# Use a different port\nstreamlit run app.py --server.port 8502\n\n# Or kill existing process (Windows):\nnetstat -ano | findstr :8501\ntaskkill /PID \u003cPID\u003e /F\n```\n\n### Issue 4: Dependencies Conflict\n**Error:** `error: subprocess-exited-with-error` with numpy version conflict\n\n**Cause:** Incompatible version pinning in requirements.txt\n\n**Solution:**\n```bash\n# Clear pip cache\npip cache purge\n\n# Upgrade pip\npip install --upgrade pip\n\n# Reinstall with fresh environment\npip install -r requirements.txt --no-cache-dir\n```\n\n### Issue 5: Streamlit Cloud Deployment Error\n**Error:** TensorFlow installation fails on Streamlit Cloud\n\n**Cause:** Streamlit Cloud trying to install with wrong Python version\n\n**Solution:**\n```\n1. Delete the app from Streamlit Cloud\n2. Redeploy and select Python 3.11 in Advanced Settings\n3. Click Deploy\n```\n\n---\n\n## 🌐 Streamlit Cloud Deployment\n\n### Deploy Your App (Live on Web)\n\n1. **Push code to GitHub**:\n   ```bash\n   git add .\n   git commit -m \"Your message\"\n   git push origin main\n   ```\n\n2. **Go to Streamlit Cloud**:\n   - Visit [https://share.streamlit.io](https://share.streamlit.io)\n   - Sign in with GitHub\n\n3. **Deploy New App**:\n   - Click \"New app\"\n   - Select repository: `vivek-kumar-P/Image-Classification-model`\n   - Branch: `main`\n   - Main file: `app.py`\n\n4. **Configure Python Version** (IMPORTANT):\n   - Click \"Advanced settings\"\n   - Select **Python 3.11** from dropdown\n   - Click \"Deploy\"\n\n5. **Wait for deployment** (2-3 minutes):\n   - App will be live at: `https://your-username-image-classification.streamlit.app`\n\n### Troubleshooting Deployment\n\n**Build fails with TensorFlow error?**\n- Delete app → Redeploy with Python 3.11 selected\n\n**Port/Process errors?**\n- Streamlit Cloud handles this automatically, just redeploy\n\n**Dependencies not installing?**\n- Update requirements.txt with compatible versions\n- Commit → Push → Redeploy\n\n---\n\n## 📊 System Architecture\n\n### Local Development:\n```\nYour Computer\n├─ Python 3.11\n├─ Virtual Environment\n├─ Dependencies (from requirements.txt)\n├─ App code (app.py)\n├─ Models (cifar10_model.h5)\n└─ Runs on localhost:8501\n```\n\n### Streamlit Cloud:\n```\nStreamlit's Servers\n├─ Python 3.11 (selected during deploy)\n├─ Virtual Environment (auto-created)\n├─ Dependencies (installed from requirements.txt)\n├─ Your code (cloned from GitHub)\n└─ Runs 24/7 at streamlit.app URL\n```\n\n**Key Point:** Cloud app is independent from local setup! Deleting local files won't affect the live app.\n\n---\n\n## 📦 Project Structure\n\n```\nImage-Classification-model/\n├── app.py                      # Main Streamlit application\n├── train.py                    # Model training script\n├── cifar10_model.h5           # Pre-trained CIFAR-10 model\n├── requirements.txt           # Python dependencies\n├── README.md                  # Documentation (this file)\n├── .streamlit/\n│   └── config.toml            # Streamlit Cloud config\n└── Testing Images/\n    ├── CIFAR-10/              # Test images\n    └── MobileNetV2/           # Test images\n```\n\n---\n\n## 📝 Recent Updates (January 28, 2026)\n\n### Changes Made:\n✅ Fixed dependency conflicts in `requirements.txt`\n✅ Added flexible version constraints instead of strict pinning\n✅ Added `.streamlit/config.toml` for Cloud deployment\n✅ Updated app.py with better error handling\n✅ Tested on Python 3.11 with TensorFlow 2.15.0\n✅ Verified Streamlit Cloud deployment\n\n### Problems Tackled:\n1. **TensorFlow not available for Python 3.14** → Switched to Python 3.11\n2. **Dependency version conflicts** → Updated requirements.txt with compatible versions\n3. **Missing Visual C++ libraries** → Provided download and install instructions\n4. **Port conflicts on local** → Added port configuration examples\n5. **Streamlit Cloud deployment failures** → Added Python version selection guide\n\n---\n\n## 🔧 Troubleshooting Checklist\n\n| Problem | Command | Status |\n|---------|---------|--------|\n| Wrong Python version | `python --version` | Check output |\n| venv not activating | `venv\\Scripts\\activate.ps1` | PowerShell |\n| Dependencies failing | `pip install --upgrade pip` | Then reinstall |\n| App not starting | `streamlit run app.py --logger.level=error` | Debug mode |\n| Port in use | `streamlit run app.py --server.port 8502` | Alt port |\n| TensorFlow error | Use Python 3.11 | Fallback version |\n\n---\n\n## 📚 Model Information\n\n### MobileNetV2 (ImageNet)\n- **Classes:** 1,000+\n- **Input:** 224×224 RGB images\n- **Performance:** Fast, mobile-friendly\n- **Use case:** General object detection\n\n### CIFAR-10\n- **Classes:** 10 (airplane, car, bird, cat, deer, dog, frog, horse, ship, truck)\n- **Input:** 32×32 RGB images\n- **Performance:** Specialized classification\n- **Use case:** Specific object detection in 10 categories\n\n---\n\n## 🚀 Future Enhancements\n\n- [ ] Add image download with predictions\n- [ ] Add batch image processing\n- [ ] Deploy custom model training interface\n- [ ] Add prediction history\n- [ ] Mobile app version\n- [ ] Real-time webcam classification\n\n---\n\n## 📄 License\n\nThis project is open-source and available for educational and commercial use.\n\n---\n\n## 👥 Contributing\n\nFeel free to:\n- Fork the repository\n- Create issues for bugs/features\n- Submit pull requests\n- Share feedback and improvements\n\n---\n\n## 🙏 Acknowledgments\n\n- **Streamlit** - Web app framework\n- **TensorFlow** - Deep learning library\n- **Keras** - Neural network API\n- **MobileNetV2** - Pre-trained model\n- **CIFAR-10 Dataset** - Training data\n\n---\n\n## 📞 Support \u0026 Contact\n\nFor issues or questions:\n1. Check the **Troubleshooting** section above\n2. Review **Known Issues \u0026 Solutions**\n3. Open an issue on GitHub\n4. Contact the maintainer\n\n---\n\n**Last Updated:** January 28, 2026\n**Status:** ✅ Production Ready for Streamlit Cloud\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivek-kumar-p%2Fimage-classification-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivek-kumar-p%2Fimage-classification-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivek-kumar-p%2Fimage-classification-model/lists"}