This project is a Streamlit-based web app that performs structured data extraction from menu images using Google Gemini (via LangChain) and outputs a clean, downloadable CSV file. It detects food items, categories, types (Veg/Non-Veg), descriptions, prices, and add-ons from menu images.
- 🔍 Extracts structured data (restaurant, category, item, price, type, add-ons) from menu images.
- 📦 Uses Google Gemini (Generative AI) via LangChain with structured output schema.
- 🖼️ Supports image upload (JPG, PNG, JPEG).
- 📋 Displays extracted data as a table in the app.
- 💾 Exports the result as a CSV file for download.
- Python
- Streamlit – Web UI
- LangChain – LLM chaining and structured output
- Google Gemini API – Image understanding and extraction
- Pydantic – Schema validation for structured data
- Pandas – Dataframe manipulation
- dotenv – Environment variable handling
.
├── app.py # Streamlit frontend
├── model.py # Image processing, LLM calls, data transformation
├── schema.py # Pydantic schema for structured output
├── .env # Contains GOOGLE_API_KEY
├── /data # Folder to save downloaded CSVs
├── /images # Folder of menu imagesgit clone https://github.com/a2hishek/Image-Data-Extraction.git
cd image-menu-extractorpython -m venv venv
.\venv\Scripts\activate # or source venv/bin/activate on Mac
pip install -r requirements.txtCreate a .env file in the project root with the following content:
GOOGLE_API_KEY=your_google_genai_api_key
Alternatively, the app will prompt you to enter the key when running.
streamlit run app.py- Upload Image – Menu image with food categories and items.
- Gemini LLM Prompting – Image and context are sent to Gemini using LangChain with a
Pydanticschema. - Structured Response – LLM returns a JSON conforming to the schema.
- Tabular View – Parsed JSON is converted to a DataFrame.
- Download CSV – Export and save results.
Each row in the CSV contains:
- Restaurant Name & Area
- Category ID & Name
- Item ID, Name, Description, Price, Type (Veg/Non-Veg)
- Add-on Name & Price (if any)
Example 1(task_menu_1):
Example 2(task_menu_2):

