SyedMuhammadSarmad / AI-Meal-Planner

This project is a meal planning app that generates personalized meal plans based on a user's caloric needs and Personal Information. It utilizes natural language processing to generate creative meal ideas using ingredients selected by the greedy algorithm.

Home Page:https://ai-meal-planner.streamlit.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI Meal Planner App

This project is a meal planning app that generates personalized meal plans based on a user's caloric needs and food preferences. It uses gpt-4o to generate creative meal ideas using ingredients selected by the algorithm.

Try the app here

Demo

image image image

Features

  • Calculation of daily calorie needs based on user inputs like age, height, weight, and gender
  • Selection of user food preferences and allergies/restrictions
  • Generation of meal plans for breakfast, lunch, and dinner within the target calorie ranges with food items from different categories
  • Creative naming and description of meals using GPT-4o

Technology

  • Python
  • Streamlit for app UI
  • Pandas for data manipulation
  • gpt-4o for AI text generation

Add your API key to .streamlit/secrets.toml:

openai_apikey="YOUR_API_KEY"

Random greedy algorithm

  • Calculating the target calories for breakfast, lunch, and dinner based on the user's BMR.
  • Randomly selecting a food group (e.g. fruits, proteins etc).
  • Randomly selecting a food item from that group.
  • Checking if adding that item would exceed the calorie target.
  • If not, add the item to the selected ingredients list.
  • Repeating steps 2 – 5 until the calories are within 10 of the target or all items are selected.

The goal is to select a set of food items that maximize calories, while not exceeding the target calories. This is similar to the knapsack problem.


The app calculates the user's basal metabolic rate to determine their daily calorie needs. It then randomly selects ingredients from categorized food items to meet the calorie targets for each meal. The selected ingredients are passed to the gpt-4o to generate creative names and descriptions for the meals.

The project demonstrates an application of AI for personalized meal planning. It could be extended by adding user accounts, more food options, recipe instructions, etc.

About

This project is a meal planning app that generates personalized meal plans based on a user's caloric needs and Personal Information. It utilizes natural language processing to generate creative meal ideas using ingredients selected by the greedy algorithm.

https://ai-meal-planner.streamlit.app


Languages

Language:Python 100.0%