A Streamlit-based web application for classifying fashion items using deep learning. The app allows you to either classify uploaded images or train your own model on the Fashion MNIST dataset.
- Upload and classify fashion item images
- View prediction confidence scores
- See class probability distributions
- Supports JPG, JPEG, and PNG formats
- Train a CNN model directly in the browser
- Real-time training visualization
- Adjustable training parameters (epochs, batch size, learning rate)
- Live loss and accuracy plots
- Early stopping capability
- Model download after training
- View sample images from the dataset
- Training/validation split visualization
- Confusion matrix
- Example predictions on test set
-
Clone this repository:
git clone https://github.com/yourusername/garment-classification.git cd garment-classification -
Create and activate a virtual environment (recommended):
python -m venv venv .\venv\Scripts\activate # On Windows source venv/bin/activate # On macOS/Linux
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
-
The app will open in your default web browser at
http://localhost:8501
- Go to the "🔍 Image Classification" tab
- Click "Browse files" to upload an image
- View the prediction results and confidence scores
- Go to the "🎓 Train Your Own Model" tab
- Adjust the training parameters as needed
- Click "Start Training" to begin
- Monitor the training progress with live plots
- Use "Stop Training" to halt the training process
- After training, view test metrics and example predictions
- Download the trained model if desired
- Python 3.8+
- TensorFlow 2.12.0
- Streamlit 1.31.0
- NumPy 1.24.3
- Matplotlib 3.7.1
- scikit-learn 1.2.2
- Pillow 10.0.0
- h5py 3.8.0
- seaborn 0.12.2
garmentcv-app/
├── app.py # Main application file
├── requirements.txt # Python dependencies
└── README.md # This file
This application currently uses a mock model for demonstration purposes. To integrate with a real model:
- Train or obtain a pre-trained model for garment classification
- Save the model in the appropriate format (e.g., .h5 for Keras models)
- Update the
app.pyto load your model instead of the mock model - Adjust the preprocessing and prediction functions as needed for your model
- Integrate with a pre-trained fashion model (e.g., ResNet, EfficientNet)
- Add support for multiple garments in a single image
- Implement virtual try-on features
- Add more detailed style recommendations
- Support for video input and real-time analysis
This project is licensed under the MIT License - see the LICENSE file for details.