Skip to content

dyannadle/Recipe-Generator

Repository files navigation

SnapCook AI: Cross-Modal Food Recipe Generator 🍳

License: MIT Python 3.9+ React 18 Docker Ready

Transform your food photography into culinary reality. SnapCook AI leverages state-of-the-art Inverse Cooking Transformers to identify ingredients and generate step-by-step instructions from a single photo.


🚀 Key Features

  • 📸 Inverse Cooking Engine: Sophisticated Cross-Modal Transformer that "sees" ingredients and transcribes them into recipes.
  • 🥗 Dynamic Nutritional Labels: Instant macro-nutrient estimation (Calories, Protein, Carbs, Fat) per identified dish.
  • 🛒 Smart Shopping List: Sync identified ingredients directly to a persistent, manageable checklist.
  • 🔐 Secure User Hub: JWT-powered authentication to save, rate, and track your culinary history.
  • 🌓 Premium UI/UX: Modern, responsive interface with full Dark Mode support and smooth Framer Motion animations.

🧠 How It Works

SnapCook AI operates on a Cross-Modal Transformer architecture:

  1. Image Encoder (CNN): Extracts deep visual features from the uploaded food image.
  2. Ingredient Predictor: A multi-head attention mechanism predicts ingredients using a specialized loss function (SoftIoU and Cardinality Penalty).
  3. Instruction Decoder: An autoregressive transformer decodes sequential cooking steps based on the predicted ingredient embeddings and visual context.

🛠️ Technology Stack

Layer Technologies
Frontend React 18, Vite, Tailwind CSS, Framer Motion, Lucide Icons
Backend Flask (Python), SQLAlchemy ORM, Flask-Limiter, Flask-Caching
AI / ML PyTorch, Cross-Modal Transformers, CNN, NumPy, Pillow
Database PostgreSQL / SQLite, SQLAlchemy
DevOps Docker, Docker Compose, Nginx, Hugging Face Spaces

📂 Project Structure

.
├── Foodimg2Ing/            # Backend (Flask Application)
│   ├── modules/            # Transformer & CNN Layer Definitions
│   ├── utils/              # Security, Metrics, and Helper Logic
│   ├── data/               # AI Model Weights (.ckpt) and Vocabularies
│   └── static/             # Processed Demo Images
├── frontend/               # Frontend (React 18 + Vite)
│   ├── src/
│   │   ├── components/     # UI Components (ImageUpload, RecipeCard, etc.)
│   │   └── contexts/       # Auth and Global State Management
├── documents/              # Roadmap, Deployment Guides, and API Docs
├── Dockerfile              # Docker Build Instructions
└── docker-compose.yml      # Multi-container Orchestration

🚦 Quick Start

1. Requirements

  • Docker & Docker Compose (Recommended)
  • OR Python 3.9+ & Node.js 18+

2. Setup

  1. Clone the repository.
  2. Rename .env.example to .env and configure your keys.

3. Run with Docker

docker-compose up --build

The app will be available at http://localhost:8000.


📖 Deployment & Docs


📄 License

Distributed under the MIT License. See LICENSE for more information.

About

ai-powered Recipe Generator: Transcribe food images into detailed recipes, ingredients, and nutrition facts. Built with React, Flask, and Transformer models. Docker-ready for Hugging Face.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors