This project is an end-to-end image classification project which has the proper pipelines in place to get training data from a source url, train and evaluate a convolutional neural network, and deploy that model with a simple frontend for inference.
This particular model is trained to classify 525 bird species based on a dataset sourced from Kaggle: https://www.kaggle.com/datasets/gpiosenka/100-bird-species
Visit https://birdfinderz.azurewebsites.net
Note: Page may take a while to load
- Clone this repository
git clone https://github.com/rohith42/bird-finderz.git
- Create a conda environment
conda create -n bird python=3.11 -y
conda activate bird
- Install the required packages
cd bird-finderz
pip install -r requirements.txt
- Run the application and visit the specified url
python app.py
-
Visit the
/getTrainedModel
endpoint first to download the trained model and necessarybirds.csv
file to your computer -
Return to the home route and upload an image of a bird to find out what species it is!
Run python main.py
to execute the entire pipeline from data ingestion to model training and evaluation. Make sure you have a capable system with a decent GPU for training or modify params.yaml
to match your system.
The code is currently set up to fine-tune the VGG-16 model with ImageNet weights. You can change the model architecture in src/classifier/components/prepare_base_model.py
in the PrepareBaseModel.get_base_model()
method.
- Update
config.yaml
- Update
secrets.yaml
[Optional] - Update
params.yaml
- Update the entity in
src/classifier/entity/config_entity.py
- Update the configuration manager in
src/classifier/config/configuration.py
- Update the components in
src/classifier/components
- Update the pipeline in
src/classifier/pipeline
- Update
main.py
- Update
dvc.yaml
DVC prevents running pipelines unnecessarily. Relevant DVC commands:
dvc init # Initialize DVC repo
dvc repro # Run all the necessary pipelines
dvc dag # Visualize dependencies between pipelines
- Create a resource group for this project in your Azure portal
- Create an Azure container registry for the Docker image
- Save the username and password!
- Download and install Docker Desktop on your computer (make sure it's running)
- Build the Docker image of the source code
docker build -t [CONTAINER_REGISTRY_NAME].azurecr.io/[REPOSITORY_NAME]:latest .
- Push the Docker image to the container registry
docker login [CONTAINER_REGISTRY_NAME].azurecr.io # Use the username and password from step 2 docker push [CONTAINER_REGISTRY_NAME].azurecr.io/[REPOSITORY_NAME]:latest
- Create and deploy a new Web App Service in Azure, using the Docker image that should be in the Container Registry
- After it's deployed, go to the Deployment Center for the Web App and follow the instructions for CI/CD deployment with Github Actions