change the order of nutrition facts calculation.
Browse files
index.py
CHANGED
|
@@ -21,17 +21,9 @@ def main():
|
|
| 21 |
#items = ['Item 1', 'Item 2', 'Item 3']
|
| 22 |
|
| 23 |
#list to of Ingredients camptured
|
| 24 |
-
ingredientsList =["apple", "orange", "mango"
|
| 25 |
|
| 26 |
-
|
| 27 |
-
content = {}
|
| 28 |
-
for ingredient in ingredientsList:
|
| 29 |
-
content[ingredient] = askGPT(f"Give me your estimate the calories, grams of sugar, grams of fat, and grams of carbohydrates per 100g of {ingredient} as a list")
|
| 30 |
-
|
| 31 |
-
# Display expanders for each item
|
| 32 |
-
for ingredient in ingredientsList:
|
| 33 |
-
with st.sidebar.expander(ingredient):
|
| 34 |
-
st.write(content[ingredient])
|
| 35 |
|
| 36 |
|
| 37 |
# Create a VideoCapture object to access the webcam
|
|
@@ -59,6 +51,19 @@ def main():
|
|
| 59 |
|
| 60 |
# Display the captured ingredients
|
| 61 |
st.write("Captured Ingredients:", session_state['ingredientsList'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Display recipes if "Done" is clicked
|
| 64 |
while not done_button:
|
|
|
|
| 21 |
#items = ['Item 1', 'Item 2', 'Item 3']
|
| 22 |
|
| 23 |
#list to of Ingredients camptured
|
| 24 |
+
ingredientsList =["apple", "orange", "mango"] #list()
|
| 25 |
|
| 26 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
# Create a VideoCapture object to access the webcam
|
|
|
|
| 51 |
|
| 52 |
# Display the captured ingredients
|
| 53 |
st.write("Captured Ingredients:", session_state['ingredientsList'])
|
| 54 |
+
|
| 55 |
+
button_clicked = st.sidebar.button('Done')
|
| 56 |
+
if button_clicked:
|
| 57 |
+
# Define content for each item
|
| 58 |
+
content = {}
|
| 59 |
+
for ingredient in ingredientsList:
|
| 60 |
+
content[ingredient] = askGPT(f"Give me your estimate the calories, grams of protein, grams of sugar, grams of fat, and grams of carbohydrates per 100g of {ingredient} as a list")
|
| 61 |
+
|
| 62 |
+
# Display expanders for each item
|
| 63 |
+
for ingredient in ingredientsList:
|
| 64 |
+
with st.sidebar.expander(ingredient):
|
| 65 |
+
st.write(content[ingredient])
|
| 66 |
+
displayRecipes(ingredientsList)
|
| 67 |
|
| 68 |
# Display recipes if "Done" is clicked
|
| 69 |
while not done_button:
|