A streamlined image classification pipeline designed for analyzing and classifying images using deep learning techniques. This project focuses on building and deploying an effective image classification model with customizable dataset paths. The primary use case is detecting COVID-19 cases from X-ray images, but the structure can be adapted for various image classification problems.
- Efficient setup for training and testing datasets.
- Suppression of unnecessary warnings for a cleaner output.
- Structured for easy integration with other image datasets.
- Customizable for various image classification use cases.
- Advanced model architectures support like ResNet, InceptionNet, etc.
img-classifier/
├── data/ # Contains training and testing datasets
├── notebooks/ # Jupyter notebooks for experimentation
├── models/ # Pre-trained models and custom models
├── image_classification_pipeline.ipynb # Main pipeline notebook
├── README.md # Project documentation
└── .gitignore # Git ignore file
-
Clone the repository:
git clone https://github.com/TamerOnLine/img-classifier.git
-
Navigate to the project directory:
cd img-classifier
-
Install the required libraries:
pip install -r requirements.txt
Once you have set up the environment and installed the required libraries, you can run the following code snippet to test the model on a new image:
from keras.models import load_model
from keras.preprocessing import image
import numpy as np
# Load the trained model
model = load_model('models/covid_classifier.h5')
# Load and preprocess the image
img = image.load_img('path_to_image.jpg', target_size=(224, 224))
img = image.img_to_array(img)
img = np.expand_dims(img, axis=0)
# Predict on the new image
prediction = model.predict(img)
print(f"Predicted class: {prediction}")