This project demonstrates how to build an image classification web application using the CIFAR-10 dataset, TensorFlow, and Flask. The web application allows users to upload images and classify them into one of 10 categories.
- Train a Convolutional Neural Network (CNN) on the CIFAR-10 dataset.
- Evaluate the model on test data.
- Save and load the trained model.
- Upload images through a web interface and classify them.
- Display classification results with corresponding images.
-
Clone the repository:
git clone https://github.com/devhadvani/image-classification-keras-flask.git cd image-classification-keras-flask
-
Install dependencies:
pip install -r requirements.txt
Run the script to train the CNN model on the CIFAR-10 dataset:
```bash
python train_model.py
```
The trained model will be saved as cifar10_model.h5
.
-
Start the Flask web application:
python app.py
-
Open your web browser and navigate to
http://127.0.0.1:5000/
. -
Use the web interface to upload images and classify them.
```plaintext
cifar10-image-classification-web-app/
│
├── app.py # Flask web application
├── train_model.py # Script to train the CNN model
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # HTML template for the web interface
└── static/
└── uploads/ # Directory to save uploaded images
```
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the MIT License.