Skip to content

A multimodal demo showcasing image understanding and conversational AI capabilities with Google Gemini Vision and Streamlit.

Notifications You must be signed in to change notification settings

aliamarliana/gemini-image-insight-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

🍎 Gemini Nutrition Analyzer

An AI-powered nutrition assistant that identifies food items from images and estimates calorie intake using Google’s Gemini Vision model — all through an interactive Streamlit app.


🚀 Overview

This project demonstrates how to integrate Google’s Gemini Vision model into a Streamlit web app to perform multimodal reasoning — combining text prompts and image understanding.
Upload a photo of food, and the app will analyze its contents and estimate calorie intake for each item.


🧠 Key Features

  • 🖼️ Image Understanding: Processes and interprets uploaded images using Gemini Vision.
  • 🍽️ Calorie Estimation: Provides estimated calorie counts for each food item detected.
  • 💬 Prompt Customization: Accepts user input for custom queries or contextual instructions.
  • ⚙️ Streamlit UI: Simple and lightweight frontend for easy interaction.
  • ⚠️ Input Validation: Ensures both image and prompt are provided before generating a response.

🧩 Tech Stack

  • Python 3.10+
  • Streamlit
  • Google Generative AI (Gemini)
  • Pillow (PIL)
  • dotenv

📦 Project Structure

📂 gemini-nutrition-analyzer
├── app.py
├── requirements.txt
├── .env
└── README.md

🪜 Setup Guide

1️⃣ Create and Activate Virtual Environment

Using conda:

conda create -p venv python==3.10 -y
conda activate ./venv

2️⃣ Install Dependencies

Make sure you have a requirements.txt file in your project root, then run:

pip install -r requirements.txt

3️⃣ Set Up Environment Variables

Create a .env file in your project directory and add your Google API key:

GOOGLE_API_KEY=your_google_api_key_here

4️⃣ Run the Streamlit App

Launch the app locally using:

streamlit run app.py

🖥️ App Interface

  1. Enter a text prompt (e.g., “Identify and estimate calories in this image”).
  2. Upload an image (JPEG, PNG).
  3. Click “Analyze Image” to process the inputs.
  4. The app validates that both a prompt and image are provided.
  5. View the AI-generated calorie breakdown and total estimate.

🎥 Code Reference

This project was inspired by the tutorial by Krish Naik:
🔗 Complete Langchain GEN AI Crash Course With 6 End To End LLM Projects With OPENAI,LLAMA2,Gemini Pro

About

A multimodal demo showcasing image understanding and conversational AI capabilities with Google Gemini Vision and Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages