Skip to content

AmanStarLitePro/Potato-Disease-Classification

Repository files navigation

Potato Disease Classification

Welcome to the Potato Disease Classification repository! , this project leverages cutting-edge computer vision and machine learning technologies to enhance Potato Leaf Disease Classification.

📄 Introduction

This code sets up a FastAPI server that utilizes a pre-trained TensorFlow model to classify images uploaded via API into different classes of potato diseases. The primary objectives is:

  • Detect the Disease in Potato Leaf.

The system integrates CNN Architecture to detect disease in leaf.

🗂 Table of Contents

📦 Requirements

  1. Numpy
  2. uvicorn
  3. PIL (Pillow)
  4. Tensorflow
  5. FastAPI
  6. Postman Software

🎥 Demo Video

Sample.mp4

🎯 Features

Ping Endpoint

  • Responds with "Server is Ready" to indicate the server status.

Predict Endpoint

  • Accepts an image file via POST request, processes it using a pre-trained TensorFlow model (my_model.keras), and returns the predicted class and confidence score of the image.

Output

  • The model outputs predicted class and confidence of prediction.

Server Access Using Postman Software

  • API accessible via the local host server at http://localhost:8000.

  • Install Postman:

  • If you haven't already, download and install Postman from here.

  • Create a New Request:

  • Open Postman and click on New to create a new HTTP request.

  • Set the Request Type and URL:

  • Select POST as the request type.

  • Enter the API endpoint URL: http://localhost:8000/predict.

  • Set Headers:

  • Add a new header with key 'Content-Type' and value 'multipart/form-data'.

  • Set the Body:

  • Click on the Body tab and Select the "form-data" option.

  • Add a new key-value pair where the key is file (must match the parameter name file in your FastAPI endpoint) and the value is the image file you want to classify. You can either drag and drop the image file or select it using the file picker.

  • Send the Request:

  • Click on Send to submit your request to the API.

  • You should receive a response with the predicted class and confidence of prediction.

For more details on using Postman, refer to the Postman Documentation.

🏁 Conclusion

This project effectively demonstrates the integration of FastAPI with TensorFlow for real-time image classification of potato diseases. By developing endpoints for server status checking and image prediction, utilizing a pre-trained deep learning model, and leveraging tools like Postman for testing, the API proves robust in handling image uploads, processing them with high accuracy, and returning actionable predictions. This solution not only showcases the synergy between modern web frameworks and AI technologies but also highlights its potential impact in agricultural sectors, offering a scalable and efficient tool for disease detection and management, ultimately contributing to improved crop health and productivity.

Future work will focus on improving the models’ accuracy, expanding the dataset, and exploring additional functionalities to enhance the system’s capabilities.

🚀 Get Started

Install Dependencies and Run the API:

pip install -r requirements.txt
python Api/main.py

## Access the API:
Open your browser and go to http://localhost:8000/ping.


Thank you for checking out our project! If you have any questions or feedback, feel free to reach out to us.

About

Detect Early Blight Leaf, Healthy Leaf, Late Blight Leaf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages