Hs8h/PlntDesNeo
๐ฟ Plant Disease Detection
This project provides a deep learning-based solution to detect and classify diseases in plant leaves. The core of the system is a pre-trained neural network model fine-tuned on a custom dataset of plant images. The project also includes a user-friendly web application built with Gradio, allowing anyone to upload an image and get an instant disease prediction. This version is specifically configured for deployment on Hugging Face Spaces.
๐ Getting Started
To get the project running on your local machine or to deploy it on Hugging Face Spaces, follow these steps.
Prerequisites
You'll need to have Python 3.8 or newer and pip installed.
Installation
- Clone the repository from GitHub:
git clone [https://github.com/samalhitesh8-sudo/PLANTAE.git](https://github.com/samalhitesh8-sudo/PLANTAE.git)- Navigate into the project directory:
cd PLANTAE- Install all the required Python libraries using the
requirements.txtfile:
pip install -r requirements.txt๐ก Usage
Running the Gradio Web Application
The easiest way to use the model is through the Gradio web application.
- Start the Gradio app from the project's root directory:
python app.py- Your default web browser will automatically open and navigate to the application. If not, open your browser and go to the local URL provided in the terminal output (e.g.,
http://127.0.0.1:7860). - Upload an image of a plant leaf. The application will use the pre-trained model to predict the disease and display the result on the screen.
Retraining the Model
If you have a new dataset or want to improve the model, you can retrain it.
- Place your new image dataset inside the
data/dataset/folder. Make sure the directory structure is suitable for the training script (e.g., organized into subfolders by class). - Run the training script:
python model/model_training.pyThis script will train a new model and save it as saved_model.h5 in the model/ directory, overwriting the old one.
๐ Project Structure
app.py: The main Gradio application that serves the web interface.model/: Contains the trained deep learning model (saved_model.h5) and the script used for training (model_training.py).data/: Holds the dataset of plant images.requirements.txt: Lists all Python dependencies required for the project.
๐ค Contributing
We welcome contributions! If you'd like to help, please follow these steps:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -m 'feat: Add a new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
