Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ menu = st.sidebar.selectbox("Menu", ["App", "User Guide"])
|
|
108 |
if menu == "App":
|
109 |
# Sidebar for user input
|
110 |
st.sidebar.title("User Input")
|
111 |
-
image_file = st.sidebar.file_uploader("Upload an image of the dish", type=["jpeg", "png"])
|
112 |
age = st.sidebar.number_input("Enter your age", min_value=18)
|
113 |
gender = st.sidebar.selectbox("Select your gender", ["male", "female"])
|
114 |
height_cm = st.sidebar.number_input("Enter your height (cm)", min_value=150.0)
|
@@ -153,22 +153,22 @@ if menu == "App":
|
|
153 |
st.markdown(f"<div style='background-color: #d1ecf1; color: #0c5460; padding: 10px; border-radius: 10px;'>{diet_plan}</div>", unsafe_allow_html=True)
|
154 |
|
155 |
else:
|
156 |
-
st.error("Please upload a valid image in JPEG or
|
157 |
|
158 |
# If the user selects the User Guide, show a detailed guide about the app
|
159 |
elif menu == "User Guide":
|
160 |
st.write("## AI Diet Planner User Guide")
|
161 |
|
162 |
st.markdown("""
|
163 |
-
Welcome to the **AI Diet Planner**! This tool helps you
|
164 |
-
|
165 |
-
###
|
166 |
-
1. **Upload
|
167 |
-
2. **
|
168 |
-
3. **Submit**: Click the
|
169 |
-
|
170 |
-
###
|
171 |
-
- **Dish
|
172 |
-
- **
|
173 |
-
- **Diet Plan**:
|
174 |
""")
|
|
|
108 |
if menu == "App":
|
109 |
# Sidebar for user input
|
110 |
st.sidebar.title("User Input")
|
111 |
+
image_file = st.sidebar.file_uploader("Upload an image of the dish", type=["jpeg", "png", "jpg", "gif"])
|
112 |
age = st.sidebar.number_input("Enter your age", min_value=18)
|
113 |
gender = st.sidebar.selectbox("Select your gender", ["male", "female"])
|
114 |
height_cm = st.sidebar.number_input("Enter your height (cm)", min_value=150.0)
|
|
|
153 |
st.markdown(f"<div style='background-color: #d1ecf1; color: #0c5460; padding: 10px; border-radius: 10px;'>{diet_plan}</div>", unsafe_allow_html=True)
|
154 |
|
155 |
else:
|
156 |
+
st.error("Please upload a valid image in JPEG, PNG, JPG, or GIF format.")
|
157 |
|
158 |
# If the user selects the User Guide, show a detailed guide about the app
|
159 |
elif menu == "User Guide":
|
160 |
st.write("## AI Diet Planner User Guide")
|
161 |
|
162 |
st.markdown("""
|
163 |
+
Welcome to the **AI Diet Planner**! This tool helps you calculate various fitness metrics and suggests personalized diet plans.
|
164 |
+
|
165 |
+
### Steps to Use the App:
|
166 |
+
1. **Upload an image of the dish**: Use the sidebar to upload an image in `.jpeg`, `.jpg`, `.png`, or `.gif` format.
|
167 |
+
2. **Fill in the personal details**: Input your age, gender, height, weight, activity level, and weight goal.
|
168 |
+
3. **Submit**: Click the submit button to receive the results.
|
169 |
+
|
170 |
+
### Features:
|
171 |
+
- **Dish Identification**: The app identifies dishes based on the uploaded image.
|
172 |
+
- **Metric Calculation**: Calculate BMI, BMR, TDEE, and daily caloric needs based on your personal information.
|
173 |
+
- **Personalized Diet Plan**: Get a customized diet plan based on the dish identified and your weight goal.
|
174 |
""")
|