Logo Lanfrica

0xdivin3/farmguard-nigeria

Domain:

agriculture

Record type:

software
Creator:
0xd
Host:
FarmGuard Nigeria is an AI-powered web application designed to help Nigerian farmers detect plant diseases and receive actionable treatment advice. The system combines Google Gemini Vision AI with a comprehensive Nigerian crop knowledge base to provide accurate, locally-relevant guidance. # FarmGuard Nigeria FarmGuard Nigeria is an AI-powered plant disease detection and crop recommendation system built for Nigerian farmers. The project combines a FastAPI backend with a static frontend to deliver image-based disease diagnosis, a crop symptom checker, and season-aware crop recommendations. ## Features - πŸ”¬ AI Image Detection - Upload a leaf photo (JPEG/PNG, max 8MB) - Detect disease and plant type using Google Gemini Vision - Returns diagnosis, symptoms, cause, treatment, urgency, and economic impact - 🌿 Symptom Checker - Select crop and symptoms for knowledge-based diagnosis - Includes Nigerian crops like Cassava, Yam, Plantain/Banana, Maize, Tomato, Rice, Cowpea, Groundnut - 🌾 Crop Recommendation - Suggests crops based on state, soil type, and season - πŸ• Diagnosis History - Saves the last 10 analyses in browser local storage - πŸ“± Frontend-ready UI - Single-page static app using HTML, CSS, and JavaScript ## Supported Crops ### Image detection - Maize - Tomato - Potato - Pepper - Orange - Soybean - (21 AI disease classes) ### Symptom checker - Cassava - Yam - Plantain / Banana - Rice - Cowpea - Groundnut ## Project Structure ``` farmguard/ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ main.py β”‚ β”œβ”€β”€ requirements.txt β”‚ β”œβ”€β”€ app/ β”‚ β”‚ └── disease_config.json β”‚ └── models/ β”‚ β”œβ”€β”€ plant_weights.weights.h5 β”‚ └── README.txt └── frontend/ └── index.html ``` ## Requirements - Python 3.11+ (recommended) - `venv` for virtual environment - `pip` for dependency installation - Google Gemini API key for image analysis ## Setup 1. Open a terminal and go to the backend folder: ```bash cd backend ``` 2. Create and activate a virtual environment: ```powershell python -m venv venv venv\Scripts\activate ``` 3. Install dependencies: ```powershell pip install -r requirements.txt ``` 4. Add a `.env` file in `backend/` with your Gemini key: ```text GEMINI_API_KEY=your_gemini_api_key_here ``` 5. Place your trained model weights file at: ```text backend/models/plant …