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.
- πΈ 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.
SnapCook AI operates on a Cross-Modal Transformer architecture:
- Image Encoder (CNN): Extracts deep visual features from the uploaded food image.
- Ingredient Predictor: A multi-head attention mechanism predicts ingredients using a specialized loss function (SoftIoU and Cardinality Penalty).
- Instruction Decoder: An autoregressive transformer decodes sequential cooking steps based on the predicted ingredient embeddings and visual context.
| 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 |
.
βββ 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
- Docker & Docker Compose (Recommended)
- OR Python 3.9+ & Node.js 18+
- Clone the repository.
- Rename
.env.exampleto.envand configure your keys.
docker-compose up --build
The app will be available at http://localhost:8000.
Distributed under the MIT License. See LICENSE for more information.