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 --buildThe app will be available at http://localhost:8000.
Distributed under the MIT License. See LICENSE for more information.