An AI-powered Health Management application built with Streamlit and Google Gemini API that helps users analyze food images to estimate calories and classify food items.
- 📷 Upload food images (JPG, JPEG, PNG)
- 🤖 Analyze food items using Google Gemini multimodal model
- 🔢 Estimate total calories with detailed breakdown
- 🍎 Classify food into categories (fruits, vegetables, protein, grains, desserts, etc.)
- 💡 Option to provide additional context (e.g., portion size)
- Python 3.10+
- Streamlit – UI framework
- Google Gemini API – AI model for image + text understanding
- Pillow (PIL) – Image processing
- python-dotenv – Manage API keys securely
AI_Nutritionist_App/
│── app.py # Main Streamlit app
│── .env # Environment variables
| (contains GOOGLE_API_KEY)
│── requirements.txt # Python dependencies
│── README.md # Project documentation
-
Clone the repository
git clone https://github.com/22MH1A42G1/AI_Nutritionist_App.git cd AI_Nutritionist_App -
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # For Linux/Mac source venv\Scripts\activate # For Windows
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
- Create a .env file in the root folder and add your Google Gemini API key:
GOOGLE_API_KEY=your_api_key_here
- Run the app
python -m streamlit run app.py
-
Open the app in your browser (default: http://localhost:8501).
-
Choose a task:
-
Calorie Estimation → Get calorie breakdown of detected food items.
-
Food Classification → Classify food into categories.
-
-
Upload a food image.
-
(Optional) Provide additional notes (e.g., portion size).
-
Click Analyze → Get AI-powered insights.
Input: Uploaded image of rice, chicken curry, and salad.
Output:
- Rice (1 cup) - 200 calories
- Chicken Curry - 350 calories
- Salad - 80 calories
Total: 630 calories
-
📊 Daily calorie tracker (using st.session_state)
-
🥗 Personalized health recommendations
-
📅 Meal logging & nutrition history
-
⚡ Deploy to Streamlit Cloud / Hugging Face Spaces
Developed by Indana Aditya
💻 GitHub