FarmAI is an advanced, AI-powered platform designed to assist custard apple farmers in managing pest outbreaks, detecting diseases, and optimizing spray schedules. The system integrates real-time weather data, satellite imagery, and biological models to provide accurate, location-based recommendations.
- Disease Detection: utilizing PyTorch-based CNNs to detect diseases from leaf images.
- Pest Prediction: sophisticated forecasting models (XGBoost) combined with biological risk assessments.
- Automated Spray Scheduling: Reinforcement Learning (RL) based scheduler for optimal chemical usage.
- Digital Twin: Integration of manual observations with satellite indices (NDVI) for precise canopy estimation.
- Research Integration: Automatic retrieval of relevant research papers for disease management.
The project is divided into two main components:
- Backend: A FastAPI-based server handling AI inference, data processing, and API endpoints.
- Frontend: A modern React application (Vite + TailwindCSS) providing the user interface.
Follow these instructions to set up the project locally.
- Python: Version 3.10 or higher
- Node.js: Version 18 or higher
- Git: For version control
The backend powers the AI and API services.
-
Navigate to the project root:
cd FarmAI -
Create a virtual environment (Recommended):
python -m venv venv
-
Activate the virtual environment:
-
Windows:
.\venv\Scripts\activate
-
macOS/Linux:
source venv/bin/activate
-
-
Install dependencies:
pip install -r requirements.txt
Note: If you have a GPU, ensure you install the CUDA version of PyTorch manually if needed.
-
Run the Server:
uvicorn src.api.app_v2:app --reload
The API will be available at
http://localhost:8000. You can view the API documentation athttp://localhost:8000/docs.
The frontend provides the interactive dashboard.
-
Navigate to the frontend directory:
cd frontend -
Install Node dependencies:
npm install
-
Run the Development Server:
npm run dev
The application will typically run at
http://localhost:5173(check the console output).
FarmAI/
├── builds/ # APK/AAB Build Artifacts
├── frontend/ # React Frontend Code
├── scripts/ # Utility Scripts
│ └── data_extraction/ # Data Processing Scripts
├── src/ # Backend Source Code
│ ├── api/ # FastAPI Endpoints and App
│ ├── automation/ # Spray Scheduling Logic
│ ├── models/ # PyTorch and XGBoost Models
│ ├── services/ # Business Logic Services
│ └── data_sources/ # Weather & Satellite Integration
├── knowledge_base/ # Research Papers / Docs
├── requirements.txt # Python Dependencies
├── build-apk.bat # Android Build Script (Windows)
└── setup-android.bat # Android Environment Setup (Windows)
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.