Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -281,8 +281,6 @@ def display_dishes_in_grid(dishes, cols=3):
|
|
281 |
st.sidebar.write(dish.replace("_", " ").capitalize())
|
282 |
|
283 |
def display_prediction_graph(class_names, confidences):
|
284 |
-
print("CLASS NAMES: ", class_names)
|
285 |
-
print("CONFIDENCES", confidences)
|
286 |
#reversing them so graph displays highest predictions at the top
|
287 |
confidences.reverse()
|
288 |
class_names.reverse()
|
@@ -319,7 +317,7 @@ def display_prediction_graph(class_names, confidences):
|
|
319 |
for spine in ax.spines.values():
|
320 |
spine.set_visible(False)
|
321 |
|
322 |
-
ax.set_title(class_names[-1], color='white', fontsize=24, fontweight='bold', ha='left', x=0.
|
323 |
|
324 |
st.pyplot(fig) # Display the plot
|
325 |
|
@@ -541,9 +539,9 @@ if recipe_submit and uploaded_image:
|
|
541 |
# st.markdown(f"*{class_name}*: {confidence:.2f}%")
|
542 |
# print(fpredictions)
|
543 |
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
|
|
|
281 |
st.sidebar.write(dish.replace("_", " ").capitalize())
|
282 |
|
283 |
def display_prediction_graph(class_names, confidences):
|
|
|
|
|
284 |
#reversing them so graph displays highest predictions at the top
|
285 |
confidences.reverse()
|
286 |
class_names.reverse()
|
|
|
317 |
for spine in ax.spines.values():
|
318 |
spine.set_visible(False)
|
319 |
|
320 |
+
ax.set_title(class_names[-1], color='white', fontsize=24, fontweight='bold', ha='left', x=0.5)
|
321 |
|
322 |
st.pyplot(fig) # Display the plot
|
323 |
|
|
|
539 |
# st.markdown(f"*{class_name}*: {confidence:.2f}%")
|
540 |
# print(fpredictions)
|
541 |
|
542 |
+
elif recipe_submit:
|
543 |
+
with col2:
|
544 |
+
response = get_response(query)
|
545 |
+
print(response)
|
546 |
+
display_response(response)
|
547 |
|