AgriVision: The AI Consultant for Farmers Inspiration Agriculture is the backbone of Pakistan, but many farmers struggle to keep their crops healthy. We learned that farmers often lose a huge part of their harvest simply because they cannot identify diseases early enough or they use the wrong pesticides. Sometimes, they even spray expensive medicine right before it rains, wasting their money. We wanted to build something that acts like an expert consultant in their pocket, not just a simple scanner.

What it does AgriVision helps farmers save their crops by combining vision with real world data. When a farmer scans a leaf, the app identifies the disease, but it does not stop there. It immediately checks the live weather forecast for their city. If rain is coming, it warns them not to spray. Then, it uses Google Search to find the exact medicine available in local markets and shows current prices.

How we built it We built the app using Python and Streamlit. The core brain is Google's Gemini 3 model. We used the OpenWeatherMap API to get live weather data and the Google Search Tool to fetch medicine prices. We also used OpenCV to draw boxes around the diseased spots on the leaf images.

Challenges we ran into The hardest part was getting the AI to work reliably with other tools. We faced a lot of errors where the model would try to "chat" instead of giving us the structured data we needed for the app. We also had trouble initially with the disease detection, where the AI would select the entire leaf instead of just the specific spots. We had to carefully tweak our instructions to fix this.

What we learned We learned that AI is much more than a chatbot. By connecting it to live weather and search tools, we turned it into an active agent that can make decisions. We also realized how important it is to build tools that are simple and accessible for the people who need them most.

Built With

Share this project:

Updates