Inspiration
Farmers face huge crop losses due to diseases and unpredictable weather. Many don't have access to expert tools to detect issues early or know the best time to apply fertilizers and pesticides. We wanted to build a simple, AI-powered assistant to help farmers protect their crops and stay on top of seasonal tasks starting with mango farms.
What it does
FarmPro.tech is a smart farming assistant that helps mango farmers:
- Detect leaf diseases using uploaded images or live camera capture with real-time video preview. Predict diseases using a PyTorch-based deep learning model trained on mango leaf images, returning confidence scores for multiple disease classifications.
- Get weather-based recommendations by automatically detecting your location and fetching 14-day forecasts from Open-Meteo API to determine optimal spraying and fertilization windows. Generate AI-powered schedules using Google Gemini 2.0 to create daily 2-week task plans based on current weather conditions (avoiding rain days for spraying).
- View annual cultivation calendars with month-by-month guidance on flowering, harvest timing, pruning, and pest management cycles.
- Extract farming terminology from analysis reports with definitions and usage context for pesticides, fungicides, and treatments.
How we built it
- PyTorch & FastAI powers the custom mango leaf disease detection model with multi-class classification and confidence scoring.
- FastAPI serves the Python backend with async endpoints for disease prediction, weather integration, and AI-generated scheduling.
- Next.js 15 with React 19 and TypeScript provides the frontend with server-side rendering and API route handlers.
- Auth0 handles secure user authentication with the Next.js SDK.
- Open-Meteo API provides free, no-key weather forecasting with 14-day predictions including rain probability, temperature, wind speed, and UV index.
- Google Gemini 2.0 Flash generates context-aware farming schedules, annual plans, disease reports, and terminology extraction.
- WebRTC/MediaDevices API enables live camera capture for real-time leaf analysis directly in the browser.
- Tailwind CSS & shadcn/ui create a responsive, accessible interface with dark mode support.
Challenges we ran into
Getting PyTorch models to load correctly with CPU-only deployment on cloud platforms required careful tensor device mapping. Integrating live camera functionality with Base64 encoding for seamless image transmission to the backend took multiple iterations. Making Gemini API generate structured JSON consistently required prompt engineering and response parsing logic. Coordinating weather data with farming logic to avoid spraying on rainy days required careful condition checking.
Accomplishments that we're proud of
Built an end-to-end AI farming assistant—from disease detection to weather-aware task scheduling. Successfully deployed a PyTorch model with FastAPI serving real-time predictions. Created a live camera feature that works seamlessly across devices. Integrated multiple AI services (PyTorch + Gemini) to provide comprehensive farming insights. Built a production-ready app with proper error handling, security, and deployment configurations.
What we learned
How to train and deploy PyTorch image classification models with FastAI and serve them via FastAPI. How to structure Next.js API routes as proxies to Python backends for better error handling. How to use Google Gemini API for context-aware text generation with structured JSON outputs. How weather APIs can be integrated into agricultural decision-making systems. How to handle real-time media streams in React and convert them to API-compatible formats.
What's next for FarmPro.tech
Expand to other crops beyond mangoes (citrus, grapes, tomatoes). Add multi-language support for farmers in rural areas. Build an SMS-based interface for low-internet regions. Improve AI model accuracy with more training data and data augmentation. Integrate soil sensor data for automated irrigation recommendations. Partner with agricultural agencies to suggest location-specific pesticide names and regulatory compliance.

Log in or sign up for Devpost to join the conversation.