How PlantGuard Works

1. Image Upload

The user uploads an image of a plant leaf. The system first detects if the image contains a leaf before proceeding.

2. Plant Type Detection

The model predicts the plant type. If confidence is high (≥90%), it proceeds. Otherwise, the user selects from top predictions.

3. Weather Data Fetching

Live location is used to fetch weather data (temperature, humidity, rainfall) via the OpenWeatherMap API.

4. Disease Detection

The image and weather data are passed to the disease detection model to predict potential plant diseases.

5. AI-Powered Recommendations

For detected diseases, the system fetches live treatment recommendations using the Gemini API.