Commit
·
616b406
1
Parent(s):
93487db
Fixed image
Browse files
index.py
CHANGED
|
@@ -16,7 +16,7 @@ def main():
|
|
| 16 |
items = ['Item 1', 'Item 2', 'Item 3']
|
| 17 |
|
| 18 |
#list to of Ingredients camptured
|
| 19 |
-
ingredientsList =[
|
| 20 |
|
| 21 |
# Define content for each item
|
| 22 |
content = {
|
|
@@ -31,10 +31,7 @@ def main():
|
|
| 31 |
st.write(content[item])
|
| 32 |
|
| 33 |
button_clicked = st.sidebar.button('Done')
|
| 34 |
-
|
| 35 |
-
displayRecipes(ingredientsList)
|
| 36 |
-
|
| 37 |
-
|
| 38 |
# Create a VideoCapture object to access the webcam
|
| 39 |
cap = cv2.VideoCapture(0)
|
| 40 |
|
|
@@ -50,13 +47,15 @@ def main():
|
|
| 50 |
# Display a placeholder for the video stream
|
| 51 |
video_placeholder = st.empty()
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
# Button to capture image
|
| 56 |
if st.button("Capture Image"):
|
| 57 |
image_path = capture_image(cap)
|
| 58 |
classification = classifyImage(image_path)
|
| 59 |
ingredientsList.append(classification)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
while True:
|
| 62 |
# Read a frame from the webcam
|
|
@@ -79,7 +78,6 @@ def displayRecipes(ingredientsList):
|
|
| 79 |
{"title": "Recipe 2", "content": "Content for Item 2."},
|
| 80 |
{"title": "Recipe 3", "content": "Content for Item 3."}
|
| 81 |
]
|
| 82 |
-
|
| 83 |
# Display the items with expanding boxes
|
| 84 |
for item in items:
|
| 85 |
with st.expander(item["title"]):
|
|
|
|
| 16 |
items = ['Item 1', 'Item 2', 'Item 3']
|
| 17 |
|
| 18 |
#list to of Ingredients camptured
|
| 19 |
+
ingredientsList =[] #list()
|
| 20 |
|
| 21 |
# Define content for each item
|
| 22 |
content = {
|
|
|
|
| 31 |
st.write(content[item])
|
| 32 |
|
| 33 |
button_clicked = st.sidebar.button('Done')
|
| 34 |
+
|
|
|
|
|
|
|
|
|
|
| 35 |
# Create a VideoCapture object to access the webcam
|
| 36 |
cap = cv2.VideoCapture(0)
|
| 37 |
|
|
|
|
| 47 |
# Display a placeholder for the video stream
|
| 48 |
video_placeholder = st.empty()
|
| 49 |
|
|
|
|
|
|
|
| 50 |
# Button to capture image
|
| 51 |
if st.button("Capture Image"):
|
| 52 |
image_path = capture_image(cap)
|
| 53 |
classification = classifyImage(image_path)
|
| 54 |
ingredientsList.append(classification)
|
| 55 |
+
|
| 56 |
+
if button_clicked:
|
| 57 |
+
displayRecipes(ingredientsList)
|
| 58 |
+
print(ingredientsList)
|
| 59 |
|
| 60 |
while True:
|
| 61 |
# Read a frame from the webcam
|
|
|
|
| 78 |
{"title": "Recipe 2", "content": "Content for Item 2."},
|
| 79 |
{"title": "Recipe 3", "content": "Content for Item 3."}
|
| 80 |
]
|
|
|
|
| 81 |
# Display the items with expanding boxes
|
| 82 |
for item in items:
|
| 83 |
with st.expander(item["title"]):
|