Spaces:
Sleeping
Sleeping
metadata
title: Food Manu Frontend
emoji: π
colorFrom: red
colorTo: gray
sdk: docker
pinned: false
license: mit
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
π½οΈ Menu Extractor & Food Image Generator
An AI-powered web application that extracts menu items from restaurant menu images and generates beautiful food images for each item using advanced machine learning models.
π Features
- πΈ Menu Image Upload: Upload menu images or capture them directly using your camera
- π€ AI Menu Extraction: Uses Google's Gemini AI to extract menu items, descriptions, and prices
- π¨ Food Image Generation: Generates high-quality food images using Stable Diffusion
- π» Beautiful Frontend: Modern, responsive web interface with live preview
- π± Mobile Friendly: Works seamlessly on desktop and mobile devices
- π Code Generation: Automatically generates clean HTML code for the extracted menu
π Demo
Try the live demo: Menu Extractor & Food Generator
π οΈ Technology Stack
- Backend: Flask (Python)
- AI Models:
- Google Gemini 1.5 Flash (Menu extraction)
- Stable Diffusion v1.5 (Image generation)
- Frontend: HTML, CSS, JavaScript
- Image Processing: Pillow (PIL)
- Deployment: Hugging Face Spaces
π Requirements
- Python 3.9+
- CUDA-compatible GPU (recommended for faster image generation)
- Google Gemini API key
π§ Installation
- Clone the repository:
git clone https://github.com/your-username/menu-extractor.git
cd menu-extractor
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.envfile and add your Gemini API key:
GEMINI_API_KEY=your_gemini_api_key_here
- Run the application:
python app.py
- Open your browser and navigate to
http://localhost:7860
π Deployment on Hugging Face Spaces
- Create a new Space on Hugging Face Spaces
- Choose "Docker" as the SDK
- Upload the following files:
app.pytemplates/index.htmlDockerfilerequirements.txtREADME.md
- Add your
GEMINI_API_KEYin the Space settings under "Variables and secrets" - Your app will be automatically deployed!
π How to Use
- Upload Image: Choose to upload a menu image from your device or take a photo using your camera
- Extract Menu: Click "Extract Menu Items" to process the image with AI
- View Results: See the beautiful menu layout with generated food images
- Get Code: Switch to code view to copy the generated HTML for your own use
π― Use Cases
- Restaurant Owners: Quickly digitize physical menus
- Web Developers: Generate menu websites for restaurant clients
- Food Bloggers: Create visual menu content
- Menu Design: Prototype digital menu layouts
π API Keys Setup
Google Gemini API
- Visit Google AI Studio
- Create a new API key
- Add it to your environment variables as
GEMINI_API_KEY
β‘ Performance Notes
- CPU Mode: Image generation will be slower but still functional
- GPU Mode: Significantly faster image generation with CUDA-compatible GPU
- Memory: Requires ~4GB RAM for optimal performance
π Troubleshooting
Common Issues:
- Model Loading Error: Ensure you have sufficient disk space and memory
- API Key Error: Verify your Gemini API key is correctly set
- Image Processing Error: Check that uploaded images are in supported formats (JPG, PNG)
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π Acknowledgments
- Google Gemini for menu extraction
- Stable Diffusion for food image generation
- Hugging Face for hosting and deployment
- Flask for the web framework
π Support
If you encounter any issues or have questions, please open an issue on GitHub.
Made with β€οΈ by Your Name