🍽️ AI Calorie Counter | GPT-4o-Powered Nutrition Estimator
📖 Introduction
AI Calorie Counter is an AI-based web application that estimates the number of calories in a meal by analyzing an image. Powered by OpenAI’s GPT-4o vision model and built with Flask, this app provides detailed breakdowns of food items and their estimated caloric values — all from a single photo.
💡 You can use the app either through a web interface or directly from the command line.
🚨 Disclaimer: This tool is for educational purposes only and should not be used for medical or dietary decisions.
🚀 Features
✔️ AI-Powered Calorie Estimation – Uses GPT-4o to analyze food images
✔️ Image Upload Support – Get instant calorie insights from a photo
✔️ Detailed JSON Output – Includes reasoning, food list, and total calories
✔️ Web Interface with Flask – Simple and intuitive for any user
✔️ Command-Line Usage – Easily estimate calories via terminal
✔️ Local Execution – No data is sent externally beyond OpenAI’s API
🏗️ Technologies
- 🐍 Python 3.12 – Main programming language
- 🤖 OpenAI GPT-4o – Vision and reasoning model
- 🌐 Flask – Web framework for the UI
- 🌿 python-dotenv – For managing environment variables
- 📦 Base64 & JSON – For image encoding and structured API response
- 🖼 Jinja2 Templates – HTML rendering in Flask
📦 Installation
1️⃣ Clone the Repository
git clone https://github.com/Yacine-Mekideche/ai-calorie-counter.git
cd ai-calorie-counter
2️⃣ Set Up Your Environment
Add in .env your OpenAI API key inside:
OPENAI_API_KEY=your_openai_key_here
3️⃣ Create a Virtual Environment
Using Conda:
conda create -n calorie-counter python=3.12
conda activate calorie-counter
Or using venv:
python -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windows
4️⃣ Install Dependencies
pip install -r requirements.txt
📦 Installation
▶️ Run the Web App
python server.py
Then open your browser and go to: http://localhost:5000
You’ll be able to upload a meal photo and get calorie estimations directly in the UI.
🎯 Demo
📬 Contact Me
💡 Let’s connect! Whether you’re interested in AI, Machine Learning, or tech collaborations, feel free to reach out.
📩 Email for business inquiries: contact@iacine.tech
© 2025 IAcine. All rights reserved.