Skip to content

DhruvParashar246/FreshCam

Repository files navigation

FreshCam

A smart fruit freshness detection app that uses computer vision and AI to identify fruits and determine their ripeness.

Features

  • 🍎 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

Setup

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Create a .env file with your API keys:
ROBOFLOW_URL=https://detect.roboflow.com
ROBOFLOW_API_KEY=your_roboflow_api_key
GEMINI_API_KEY=your_gemini_api_key

Get your API keys:

  1. Run the backend:
python app.py

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Run the app:
npm start
  1. Start the app:
npx expo start --tunnel

How It Works

  1. Take a photo of a fruit using the mobile app
  2. CV Model analyzes the image for ripeness
  3. Gemini AI identifies the fruit name (always)
  4. Fallback mechanism: If CV model fails, Gemini AI analyzes ripeness
  5. Results returned: fruit name, ripeness stage, and confidence score

API Response Format

{
  "fruit_name": "apple",
  "ripeness": "ripe",
  "confidence": 92.5,
  "source": "cv_model"
}
  • source can be: "cv_model" or "gemini_fallback"

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •