HACKACTHON_BY_THE _HCL_GUVI
This project is a Flask web app that predicts whether a plant leaf is Healthy or has Leaf Blight, and provides remedies for the detected condition.
- Upload a plant leaf image.
- Deep learning model predicts health status.
- Shows remedies for plant diseases from a JSON file.
- Clean UI using Flask templates.
plant-disease-detector/
│── app.py # Main Flask app
│── test_image.py # Image preprocessing test script
│── Requirements.txt # Dependencies
│── README.md # Documentation
│
│── model/
│ └── model.h5 # Pre-trained model (not included in repo)
│
│── data/
│ └── remedies.json # Remedies info in JSON format
│
│── templates/
│ ├── index.html # Upload form
│ └── result.html # Result display
│
└── static/ # Stores uploaded images
-
Clone this repo:
git clone https://github.com/your-username/plant-disease-detector.git cd plant-disease-detector -
Create virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # Mac/Linux venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r Requirements.txt
-
Add the trained model:
- Place
model.h5inside themodel/directory. - Place
remedies.jsoninside thedata/directory.
- Place
-
Run the Flask app:
python app.py
-
Open your browser and go to:
http://127.0.0.1:5000/
Run:
python test_image.py- Update the labels inside
app.pyif you add more classes. - Make sure
remedies.jsoncontains mappings like:
{
"Healthy": "No action needed.",
"Leaf Blight": "Apply fungicide spray and remove infected leaves."
}Developed with BY using Flask + TensorFlow