A comprehensive agricultural assistant system that provides plant disease diagnosis, seasonal planting recommendations, and weather forecasts tailored for gardeners and farmers.
-
Plant Disease Diagnosis:
- Text-based diagnosis based on symptoms description
- Image-based disease detection using machine learning
- Detailed treatment recommendations and preventive measures
-
Seasonal Planting Plans:
- Personalized planting recommendations based on location and season
- Detailed growing conditions and care instructions for each plant
- Garden size-specific advice
-
Agricultural Weather Forecasts:
- Weather predictions with agricultural interpretation
- Plant-specific advice based on upcoming weather conditions
- Customizable forecast duration
-
Multi-language Support:
- Full English and Bangla interface and responses
- Real-time translation of AI-generated content
- Backend: FastAPI, Python
- Frontend: HTML, CSS, JavaScript, Bootstrap
- AI Services:
- Google Gemini API for intelligent responses and translations
- Hugging Face Transformers for plant disease image classification
- APIs:
- OpenWeatherMap for weather data
- Async architecture for efficient API rate limiting
- Python 3.8+
- API Keys:
- Google Gemini API key
- OpenWeatherMap API key
-
Clone the repository:
git clone <repository-url> cd Brac_Hackaton -
Create a virtual environment:
python -m venv hackaton_env # On Windows hackaton_env\Scripts\activate # On Unix or MacOS source hackaton_env/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Configure API keys: Create a
.envfile in the project root:GEMINI_API_KEY=your_gemini_api_key_here WEATHER_API_KEY=your_weather_api_key_here GEMINI_MODEL=gemini-2.0-flash GEMINI_RATE_LIMIT=60 WEATHER_RATE_LIMIT=60
-
Start the server:
python main.py or python run_app.py -
Access the application:
- Web interface: http://localhost:8000/app
- API documentation: http://localhost:8000/docs
-
Plant Disease Diagnosis:
- Provide plant name and symptoms description, or
- Upload an image of the affected plant
-
Seasonal Planting Plan:
- Enter your location and season
- Optionally specify garden size and plant types of interest
-
Weather Forecast:
- Enter your location
- Select the number of forecast days
-
Language Selection:
- Click the language toggle button in the top right corner to switch between English and Bangla
-
Text-based Diagnosis:
POST /disease/diagnose- Request body:
{"plant_name": "Tomato", "disease_description": "Yellow leaves with brown spots", "additional_info": "..."}
-
Image-based Diagnosis:
POST /disease/image- Form data:
image(file upload)
POST /planting/plan- Request body:
{"location": "Dhaka", "season": "Summer", "garden_size": "Medium", "plant_types": ["vegetables", "herbs"]}
POST /weather/forecast- Request body:
{"location": "Dhaka", "days": 7}
Add ?translate=true query parameter to any endpoint to receive responses in Bangla.
The application follows a modular architecture:
- Agents: Handle specific domains (disease, planting, weather)
- Services: Provide API integration (Gemini, weather)
- Schemas: Define data models for requests/responses
- Utils: Provide helper functions and prompt templates
- Frontend: Single-page application with direct API calls
f:/Brac_Hackaton/
├── main.py # FastAPI application entry point
├── config.py # Configuration and environment variables
├── requirements.txt # Python dependencies
├── .env # Environment variables (not in repo)
├── README.md # Project documentation
├── image2disease.py # Plant disease image classifier
├── static/ # Static files
│ └── index.html # Web frontend
├── agents/ # Domain-specific agents
│ ├── disease_agent.py
│ ├── planting_agent.py
│ └── weather_agent.py
├── services/ # External service integrations
│ ├── gemini_service.py
│ ├── weather_service.py
│ └── translation_service.py
├── schemas/ # Data models
│ ├── request_models.py
│ └── response_models.py
└── utils/ # Utilities
├── prompt_templates.py
└── api_utils.py
- Make sure Docker and Docker Compose are installed on your system
- Create a
.envfile with your API keys (see Setup section above) - Build and start the container:
docker-compose up -d - Access the application at http://localhost:8000/app
-
Build the Docker image:
docker build -t plant-care-assistant . -
Run the container:
docker run -p 8000:8000 \ -e GEMINI_API_KEY=your_gemini_api_key \ -e WEATHER_API_KEY=your_weather_api_key \ -e GEMINI_MODEL=gemini-2.0-flash \ plant-care-assistant -
Access the application at http://localhost:8000/app
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for BRAC Hackathon
- Plant disease classification model: linkanjarad/mobilenet_v2_1.0_224-plant-disease-identification
- Weather data: OpenWeatherMap API
- AI capabilities: Google Gemini API