This repository contains an AI-based image classification project built using TensorFlow/Keras and OpenCV. The model is trained to classify images into different categories and can be used for various applications, such as object recognition and automated tagging.
- Uses Convolutional Neural Networks (CNNs) for image classification
- Preprocessing and augmentation using OpenCV
- Training and evaluation using TensorFlow/Keras
- Supports model saving and loading
- Simple command-line interface for predictions
To get started, clone the repository and install the required dependencies:
git clone https://github.com/imskylab/ai-image-classifier.git
cd ai-image-classifier
pip install -r requirements.txtEnsure you have a dataset of images organized into labeled folders:
/dataset/
/class_1/
image1.jpg
image2.jpg
/class_2/
image1.jpg
image2.jpg
You can modify the dataset path in the script accordingly.
To train the model, run the following command:
python train.py --dataset ./dataset --epochs 10 --batch_size 32Adjust parameters as needed.
To classify an image using the trained model:
python predict.py --image sample.jpgEvaluate the trained model on a test dataset:
python evaluate.py --test_dataset ./test_datasetThe model is saved in the models/ directory after training. You can load a saved model for inference:
from tensorflow.keras.models import load_model
model = load_model('models/image_classifier.h5')Contributions are welcome! Feel free to fork this repository and submit a pull request with improvements.
This project is licensed under the MIT License.
For any queries, reach out to yentraj@gmail.com.