Spaces:
Sleeping
Sleeping
Commit ·
16e5f33
1
Parent(s): f23cf7f
done
Browse files123---title: CTP Projectemoji: ⚡123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178# PlateMate - Your Culinary Assistant 🍽️PlateMate is a smart and interactive web app that uses state-of-the-art AI technologies to classify food images, provide key ingredients for your favorite dishes, and suggest healthier alternatives to enjoy guilt-free meals. Whether you're a home chef looking for inspiration or a health enthusiast, PlateMate has something for everyone.---## Features1. **Food Image Classification**Upload an image of any dish, and DPlateMate will identify the food with a high level of confidence. It uses a pretrained image classification model tailored for food.2. **Ingredient Suggestion**Once classified, PlateMate provides a concise, AI-generated list of main ingredients for the dish, helping you understand what goes into your favorite foods.3. **Healthier Alternatives**PlateMate doesn't stop at identification—it also suggests healthier alternatives for the classified dish using the power of OpenAI's GPT models.4. **Sample Images**Choose from predefined food images to try the app's features instantly.5. **Interactive Sidebar**Learn more about the AI models powering PlateMate and their purpose in making your culinary journey exciting and informative.---## Technologies Used1. **Streamlit**: For a responsive and user-friendly web interface.2. **Hugging Face Transformers**: To classify food images using a custom pretrained model (`Shresthadev403/food-image-classification`).3. **Hugging Face Inference API**: To generate key ingredients for classified dishes.4. **OpenAI GPT-4**: To provide healthier recipe alternatives and insights.5. **Python Libraries**: PIL for image handling, os for file operations.---## Installation Guide### Prerequisites- Python 3.8 or later- Pip- Streamlit### Steps1. Clone the repository:```bashgit clone https://huggingface.co/spaces/LuckyHappyFish/CTP_Projectcd CTP_Project```2. Install dependencies:```bashpip install -r requirements.txt```3. Add your API keys:- Create a `.streamlit/secrets.toml` file in the project directory:```toml[HF_API_KEY]value = "your_huggingface_api_key"[openai]value = "your_openai_api_key"```4. Run the app:```bashstreamlit run app.py```5. Open the app in your browser at `http://localhost:8501`.---## How It Works### **1. Upload Image**Users can upload a food image or select a sample. The app displays the image in the interface.### **2. Image Classification**Using the Hugging Face image classification pipeline, the app identifies the food item in the image.### **3. Ingredient Generation**The Hugging Face Qwen NLP model suggests the main ingredients for the identified dish.### **4. Healthier Alternatives**OpenAI GPT-4 generates a healthy recipe alternative for the dish, explaining why it is a better choice.---## Architecture Diagram```plaintext+-----------------------------------------------------------+| || PlateMate Architecture || |+-----------------------------------------------------------+| || User Interface (Streamlit) || - Upload Image || - Display Results || |+-----------------------------------------------------------+| || Backend Processing || - Image Classification (Hugging Face Transformers) || - Ingredients (Hugging Face Inference API) || - Healthy Recipes (OpenAI GPT-4) || |+-----------------------------------------------------------+| || External Services || - Hugging Face API || - OpenAI API || |+-----------------------------------------------------------+```---## Example Use Case1. **Upload an Image**A user uploads an image of a pizza.2. **Classification Output**- Food: Pizza (97.65% confidence)3. **Ingredients**- Generated: Flour, cheese, tomato sauce, olive oil, basil.4. **Healthier Alternative**- "Try a cauliflower crust pizza with reduced-fat cheese and fresh vegetables. It's lower in carbs and calories while being equally delicious!"---## Future Enhancements- **Multi-dish Recognition**: Support for identifying multiple dishes in a single image.- **Nutritional Analysis**: Detailed breakdown of macronutrients and calories.- **Meal Planning**: Suggesting weekly meal plans based on user preferences.---## Screenshots**1. Homepage****2. Classification Result**---## ContributingWe welcome contributions! To contribute:1. Fork the repository.2. Create a feature branch.3. Submit a pull request with a detailed description of your changes.---## LicenseThis project is licensed under the MIT License.---## ContactDeveloped by Muhammad Hassan Butt.Feel free to reach out via [GitHub](https://github.com/yourusername) or [LinkedIn](https://linkedin.com/in/yourprofile).Happy cooking with **PlateMate**! 🎉---title: CTP Projectemoji: ⚡
7 unmodified lines8910111213147 unmodified lines# Set page configurationst.set_page_config(page_title="DelishAI - Your Culinary Assistant",page_icon="🍽️",layout="centered",initial_sidebar_state="expanded",7 unmodified lines8910111213147 unmodified lines# Set page configurationst.set_page_config(page_title="Plate Mate - Your Culinary Assistant",page_icon="🍽️",layout="centered",initial_sidebar_state="expanded",
README.md+175
app.py+1-1