image-classifier / README.md
RaheelNaveed1
Update repository URL in README for cloning
9db07f7 unverified
---
title: E-Commerce Image Classifier
emoji: πŸ›’
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 8501
tags:
- streamlit
license: apache-2.0
---
# E-Commerce Image Classifier πŸ›’
An intelligent image classification application powered by MediaPipe and Streamlit that automatically categorizes e-commerce product images using a pre-trained deep learning model.
## 🌟 Features
- **Real-time Image Classification**: Upload images and get instant classification results
- **Batch Processing**: Upload multiple images or entire directories
- **Interactive Navigation**: Browse through multiple images with intuitive arrow controls
- **Customizable Results**: Choose how many classification results to display (1-5)
- **Confidence Scores**: Visual progress bars showing prediction confidence
- **Modern UI**: Clean, responsive interface optimized for all screen sizes
- **Pre-loaded Samples**: Default images available for quick testing
## πŸš€ Live Demo
Try the live demo on Hugging Face Spaces: [Your Space URL]
## 🎯 How to Use
1. **Upload Images**:
- Choose between "Directory" mode to upload a folder of images
- Or "Select Images" mode to pick individual files
2. **View Results**:
- See the original image on the left
- Classification results with confidence scores on the right
3. **Navigate**:
- Use arrow buttons (⬅️ ➑️) to browse through multiple images
- Current image counter shows your position in the gallery
4. **Customize**:
- Adjust "Number of classes to display" in the sidebar (1-5)
- View top predictions based on your preference
## πŸ› οΈ Tech Stack
- **Frontend**: Streamlit
- **ML Framework**: MediaPipe
- **Computer Vision**: OpenCV
- **Model**: Pre-trained TFLite classifier (ImageNet 1000 categories)
- **Language**: Python 3.12+
## πŸ“¦ Installation
### Local Setup
```bash
# Clone the repository
git clone https://github.com/travelmateen/image-classification-ecommerce
cd Image_Classifier
# Install dependencies
pip install -r requirements.txt
# Run the application
streamlit run streamlit_app.py
```
### Docker Deployment
```bash
# Build the Docker image
docker build -t image-classifier .
# Run the container
docker run -p 8501:8501 image-classifier
# Access at http://localhost:8501
```
## πŸ€— Deploy on Hugging Face Spaces
1. **Create a new Space**:
- Go to [Hugging Face Spaces](https://huggingface.co/spaces)
- Click "Create new Space"
- Select "Streamlit" as the SDK
2. **Upload your files**:
- `streamlit_app.py`
- `requirements.txt`
- `classifier.tflite`
- `images/` folder (optional)
- `README.md`
3. **Configure**:
- The app will automatically deploy using the settings in this README's header
- Wait for the build to complete
- Your app will be live!
## πŸ“‹ Requirements
```
streamlit>=1.51.0
opencv-python-headless
mediapipe>=0.10.21
```
## ⚠️ Known Limitations
- Uses pre-trained MediaPipe general classifier
- Limited to 1000 ImageNet categories
- Not customized for specific product domains
- Maximum 10MB per image
- Best results with clear, single-subject images
## πŸ’‘ Tips for Best Results
- Use clear, well-lit images
- Single subject per image works best
- Avoid ambiguous or complex scenes
- Common objects and scenes perform better
- Good focus and resolution recommended
## πŸ”§ Model Information
- **Model**: MediaPipe Image Classifier
- **Format**: TensorFlow Lite (.tflite)
- **Categories**: 1000 ImageNet classes
- **Input Size**: Variable (automatically resized to 450x300 for display)
- **Architecture**: MobileNet-based
## πŸ“„ License
This project is licensed under the MIT License - see the LICENSE file for details.
## πŸ™ Credits
**Developed by [Techtics.ai](https://techtics.ai)**
Built with:
- [MediaPipe](https://mediapipe.dev/) by Google
- [Streamlit](https://streamlit.io/)
- [OpenCV](https://opencv.org/)
## πŸ› Issues and Contributions
Found a bug or want to contribute? Please open an issue or submit a pull request on [GitHub](https://github.com/travelmateen/image-classification-ecommerce).
## πŸ“§ Contact
For questions or collaborations, visit [Techtics.ai](https://techtics.ai)
---
Made with ❀️ by Techtics.ai