100 Class Image Classification Project with MLOps Practices! This project is designed to demonstrate a robust and scalable approach to building and deploying a deep learning model for image classification. With 100 different classes of sports images, this project showcases the versatility and complexity of handling a large-scale image classification task.
├── 3.jpg
├── 5.jpg
├── README.md
├── app.py
├── artifacts
| ├── data
| | ├── sports-classification
| | | ├── test
| | | ├── train
│ │ | └── valid
│ ├── base_model
│ │ ├── base_model.keras
│ │ └── pretrained_model.keras
│ └── training
│ └── checkpoints
│ └── model_ckpt.h5
├── config
│ ├── class_index.json
│ └── config.yaml
├── dvc.yaml
├── input_image.jpg
├── notebooks
│ ├── 01_data_trail.ipynb
│ ├── 02_base_model.ipynb
│ ├── 03_model_training.ipynb
│ └── 04_model_eval.ipynb
├── params.yaml
├── reports
│ └── score.json
├── requirements.txt
├── setup.py
├── src
│ ├── LCIC
│ │ ├── __init__.py
│ │ ├── components
│ │ │ ├── __init__.py
│ │ │ ├── data_ingestion.py
│ │ │ ├── model_builder.py
│ │ │ ├── model_evaluation.py
│ │ │ └── model_training.py
│ │ ├── config
│ │ │ ├── __init__.py
│ │ │ ├── base_model_configuration.py
│ │ │ ├── configuration.py
│ │ │ ├── model_eval_configuration.py
│ │ │ └── model_training_configuration.py
│ │ ├── constants
│ │ │ ├── __init__.py
│ │ ├── entity
│ │ │ ├── __init__.py
│ │ │ ├── base_model_entity.py
│ │ │ ├── data_config_entity.py
│ │ │ ├── model_training_entity.py
│ │ │ └── model_val_entity.py
│ │ ├── main.py
│ │ ├── pipeline
│ │ │ ├── __init__.py
│ │ │ ├── stage_01_data_ingestion.py
│ │ │ ├── stage_02_base_model_building.py
│ │ │ ├── stage_03_model_training.py
│ │ │ └── stage_04_model_eval.py
│ │ ├── prediction_service.py
│ │ └── utils
│ │ ├── __init__.py
│ │ ├── common.py
│ │ └── keras_callbacks.py
├── static
│ └── prediction.css
├── template.py
└── templates
└── index.html
- data: Contains the datasets into training, validation, and test sets.
- models: Consists of pretrain model and custome architecture defined in
model_builder.py
and the training scriptmodel_training.py
. - notebooks: Jupyter notebooks for data exploration and model evaluation.
- src: All the coding implementation and helper scripts for the project.
- requirements.txt: Python dependencies required for the project.
- config.yaml: Configuration other settings for the project.
- params.yaml: Configuration of the model with hyperparameters and other settings.
- main.py: Main script to run all the stages of the project.
- app.py: For run the flask app.
-
Clone this repository:
git clone https://github.com/sadhiin/100-class-image-classifiaction.git cd 100-class-image-classifaction
-
Install the dependencies:
pip install -r requirements.txt
-
Download and organize your dataset into the
data
directory, following the structure mentioned above. -
Ensure to have the model related parameters in
params.yaml
file. -
Configure your info (like dataset selected pretrain model) and settings in
config/config.yaml
.
To train the model, run the following command:
python src/LCIC/main.py
Use dvc for tracking the stages
dvc repro
This will use the configurations specified in config/config.yaml
and save the trained model in the artifacts/trained_model
directory.
Automatic model evaluatoin will done on test set by running the src/LCIC/main.py
or dvc repro
command.
Fourther if you want's to explore the code can be found at
Explore model performance by running the Jupyter notebooks in the notebooks/04_model_eval.ipynb
directory:
jupyter notebook notebooks/
This ensures consistent and reproducible deployments across different environments.
This project supports CI/CD pipelines to automate testing and deployment processes. Integrate with your preferred CI/CD service for seamless automation.
Feel free to contribute by opening issues or submitting pull requests. We appreciate your feedback and collaboration!
Happy coding! 🚀