This is a project on Tomato leaf classification with dockerization and deployment in Azure.
Our classes are:
- Tomato___Bacterial_spot
- Tomato___Early_blight
- Tomato___healthy
- Tomato___Late_blight
- Tomato___Leaf_Mold
- Tomato___Septoria_leaf_spot
- Tomato___Spider_mites Two-spotted_spider_mite
- Tomato___Target_Spot
- Tomato___Tomato_mosaic_virus
- Tomato___Tomato_Yellow_Leaf_Curl_Virus
-
Clone the repository:
git clone https://github.com/your-repo/tomato-leaf-classification.git
-
Install the requirements using the
requirements.txt
file:pip install -r requirements.txt
-
Create the following folders:
Datasets
: This folder will contain your dataset.ML
: This folder is where you should add your ML model.
-
Download the dataset from Tomato Leaf Disease Detection on Kaggle and place it in the
Datasets
folder. -
Correct the paths to the tomato images Dataset and train the Model using the code in ML/train.ipynb.
-
Add your ML model to the
ML
folder and change the paths in the code to point to your model. -
Navigate to the main directory and run the following command to start the application:
uvicorn BACKEND.main:app
Now you should be able to access the API on your web browser on:
http://127.0.0.1:8000/docs
-
If you want to dockerize the the application download and install docker in your desktop run the following command in the terminal.
docker build -t <your_docker_image_name> .
-
Now you can create the docker container manually through the docker desktop or run the command in the terminal to run the container:
docker run -p 8000:8000 <your_docker_image_name>
-
To publish on the docker hub.
First Create a new docker tag using the following command:
docker tag <your_docker_image_name> <your_username>/<your_docker_image_name>:v1.0
Then push the tag to the docker hub:
docker push <your_docker_image_name>/<your_docker_image_name>:v1.0
-
Now your docker image is ready to be shared and hosted in different platforms