Skip to content

AI Nutrition Vision analyzes food images using OpenAI Vision to detect food items and produce detailed nutrition insights (calories, protein, fat, serving size, etc.) with clean Streamlit UI.

Notifications You must be signed in to change notification settings

Shehjad2019/ai-nutrition-vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฝ๏ธ AI Nutrition Vision โ€” Food Recognition & Nutrition Analyzer

Powered by OpenAI GPT-4o Vision + Streamlit

ai-nutrition-vision is an AI-powered food image analysis app that identifies food items and generates structured nutritional information using OpenAI Vision (GPT-4o).

Upload a food image โ†’ AI identifies the food โ†’ returns a description or a detailed JSON nutrition breakdown.

๐Ÿš€ Features ๐Ÿ” Food Recognition

Identifies the food shown in the image

Provides a clean, human-readable description

Useful for calorie-tracking & diet apps

๐Ÿงฎ Nutrition Analysis (JSON Output)

AI returns structured data:

{ "food_name": "", "serving_description": "", "calories": "", "fat_grams": "", "protein_grams": "", "confidence_level": "" }

Perfect for:

Fitness apps

Meal trackers

Diet automation tools

๐Ÿ–ผ๏ธ Vision AI Powered

Uses GPT-4o Vision:

Reads image content

Understands food types

Produces contextual nutrition insights

๐ŸŽจ Beautiful Streamlit Interface

Drag & drop food image upload

Toggle between description vs. nutrition JSON

Clean results section

๐Ÿ“ Project Structure ai-nutrition-vision/ โ”œโ”€โ”€ app.py โ”œโ”€โ”€ requirements.txt โ”œโ”€โ”€ .env.example โ”œโ”€โ”€ .gitignore โ””โ”€โ”€ README.md

๐Ÿ”ง Setup Instructions 1๏ธโƒฃ Clone the Repository git clone https://github.com/Shehjad2019/ai-nutrition-vision.git cd ai-nutrition-vision

2๏ธโƒฃ Create a Virtual Environment python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows

3๏ธโƒฃ Install Dependencies pip install -r requirements.txt

4๏ธโƒฃ Add Your API Key

Copy:

cp .env.example .env

Then fill in .env:

OPENAI_API_KEY=your_openai_api_key_here

โ–ถ๏ธ Run the App streamlit run app.py

Upload a food image โ†’ choose mode โ†’ click Analyze Food.

๐Ÿง  How It Works 1๏ธโƒฃ Upload an image

User uploads jpg/png โ†’ Streamlit displays it.

2๏ธโƒฃ Image โ†’ Base64

The app converts the image to Base64 for OpenAI Vision.

3๏ธโƒฃ AI Vision Processing

The model receives:

Image

Text prompt And returns:

Either a human-readable description

Or a structured JSON nutrition output

4๏ธโƒฃ Display Results

AI output is displayed inside Streamlit.

๐Ÿ”‘ Environment Variables OPENAI_API_KEY=your_openai_api_key_here

๐Ÿ‘ค Author

Shehjad Patel GitHub: https://github.com/Shehjad2019

โญ Support

If this project helped you, please โญ star the repo on GitHub!

๐Ÿ‘‰ https://github.com/Shehjad2019/ai-nutrition-vision

About

AI Nutrition Vision analyzes food images using OpenAI Vision to detect food items and produce detailed nutrition insights (calories, protein, fat, serving size, etc.) with clean Streamlit UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages