Skip to content

Navigation Menu

Sign in
Sign up

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

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /