A smart fruit freshness detection app that uses computer vision and AI to identify fruits and determine their ripeness.
- 🍎 Fruit Identification: Uses Google Gemini AI to accurately identify fruit types
- 🎯 Ripeness Detection: Computer vision model detects if fruit is unripe, ripe, or overripe
- 🔄 AI Fallback: Automatically uses Gemini AI as fallback when CV model fails, ensuring reliable results
- 📱 Mobile App: React Native/Expo frontend for easy photo capture
- ⚡ FastAPI Backend: High-performance API for image analysis
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -r requirements.txt- Create a
.envfile with your API keys:
ROBOFLOW_URL=https://detect.roboflow.com
ROBOFLOW_API_KEY=your_roboflow_api_key
GEMINI_API_KEY=your_gemini_api_keyGet your API keys:
- Roboflow: https://roboflow.com
- Google Gemini: https://makersuite.google.com/app/apikey
- Run the backend:
python app.py- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Run the app:
npm start- Start the app:
npx expo start --tunnel- Take a photo of a fruit using the mobile app
- CV Model analyzes the image for ripeness
- Gemini AI identifies the fruit name (always)
- Fallback mechanism: If CV model fails, Gemini AI analyzes ripeness
- Results returned: fruit name, ripeness stage, and confidence score
{
"fruit_name": "apple",
"ripeness": "ripe",
"confidence": 92.5,
"source": "cv_model"
}sourcecan be:"cv_model"or"gemini_fallback"