Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def main():
|
|
78 |
probs = outputs.logits.softmax(dim=1)
|
79 |
percentage = round(probs[0, label_num].item() * 100, 2)
|
80 |
|
81 |
-
st.write("The
|
82 |
|
83 |
if label_num==0:
|
84 |
st.write("Bread (" + f"{percentage}%)")
|
@@ -106,11 +106,11 @@ def main():
|
|
106 |
st.write("Vegetable (" + f"{percentage}%)")
|
107 |
|
108 |
|
109 |
-
select_health = st.selectbox("Select one:", ["Choose
|
110 |
if select_health == "Healthy":
|
111 |
st.write("You selected healthy for", "Bread" if label_num==0 else "Dairy" if label_num==1 else "Dessert" if label_num==2 else "Egg" if label_num==3 else "Fried Food" if label_num==4 else "Fruit" if label_num==5 else "Meat" if label_num==6 else "Noodles" if label_num==7 else "Rice" if label_num==8 else "Seafood" if label_num==9 else "Soup" if label_num==10 else "Vegetable")
|
112 |
# Add code to fetch healthy recipe here
|
113 |
-
elif select_health == "Non-
|
114 |
st.write("You selected non-healthy for", "Bread" if label_num==0 else "Dairy" if label_num==1 else "Dessert" if label_num==2 else "Egg" if label_num==3 else "Fried Food" if label_num==4 else "Fruit" if label_num==5 else "Meat" if label_num==6 else "Noodles" if label_num==7 else "Rice" if label_num==8 else "Seafood" if label_num==9 else "Soup" if label_num==10 else "Vegetable")
|
115 |
# Add code to fetch unhealthy recipe here
|
116 |
|
|
|
78 |
probs = outputs.logits.softmax(dim=1)
|
79 |
percentage = round(probs[0, label_num].item() * 100, 2)
|
80 |
|
81 |
+
st.write("The Predicted Classification is:")
|
82 |
|
83 |
if label_num==0:
|
84 |
st.write("Bread (" + f"{percentage}%)")
|
|
|
106 |
st.write("Vegetable (" + f"{percentage}%)")
|
107 |
|
108 |
|
109 |
+
select_health = st.selectbox("Select one:", ["Choose Healthy or Non-Healthy (Not Functional Yet)", "Healthy", "Non-Healthy"])
|
110 |
if select_health == "Healthy":
|
111 |
st.write("You selected healthy for", "Bread" if label_num==0 else "Dairy" if label_num==1 else "Dessert" if label_num==2 else "Egg" if label_num==3 else "Fried Food" if label_num==4 else "Fruit" if label_num==5 else "Meat" if label_num==6 else "Noodles" if label_num==7 else "Rice" if label_num==8 else "Seafood" if label_num==9 else "Soup" if label_num==10 else "Vegetable")
|
112 |
# Add code to fetch healthy recipe here
|
113 |
+
elif select_health == "Non-Healthy":
|
114 |
st.write("You selected non-healthy for", "Bread" if label_num==0 else "Dairy" if label_num==1 else "Dessert" if label_num==2 else "Egg" if label_num==3 else "Fried Food" if label_num==4 else "Fruit" if label_num==5 else "Meat" if label_num==6 else "Noodles" if label_num==7 else "Rice" if label_num==8 else "Seafood" if label_num==9 else "Soup" if label_num==10 else "Vegetable")
|
115 |
# Add code to fetch unhealthy recipe here
|
116 |
|