Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -430,6 +430,9 @@ if recipe_submit and uploaded_image:
|
|
430 |
|
431 |
fig, ax = plt.subplots(figsize=(8, 6))
|
432 |
bars = ax.barh(class_names, confidences, color=cmap(norm(confidences)))
|
|
|
|
|
|
|
433 |
|
434 |
# Add labels inside the bars, aligned to the right
|
435 |
for bar in bars:
|
@@ -438,7 +441,11 @@ if recipe_submit and uploaded_image:
|
|
438 |
va='center', ha='right', color='white', fontweight='bold')
|
439 |
|
440 |
ax.set_xticklabels([]) #remove x label
|
441 |
-
|
|
|
|
|
|
|
|
|
442 |
st.pyplot(fig) # Display the plot in the Streamlit app
|
443 |
|
444 |
# call openai to pick the best classification result based on query
|
|
|
430 |
|
431 |
fig, ax = plt.subplots(figsize=(8, 6))
|
432 |
bars = ax.barh(class_names, confidences, color=cmap(norm(confidences)))
|
433 |
+
|
434 |
+
fig.patch.set_alpha(0.2) # Transparent background
|
435 |
+
fig.patch.set_boxstyle("round,pad=0.1,rounding_size=15") # rounded edges
|
436 |
|
437 |
# Add labels inside the bars, aligned to the right
|
438 |
for bar in bars:
|
|
|
441 |
va='center', ha='right', color='white', fontweight='bold')
|
442 |
|
443 |
ax.set_xticklabels([]) #remove x label
|
444 |
+
|
445 |
+
#no borders
|
446 |
+
for spine in ax.spines.values():
|
447 |
+
spine.set_visible(False)
|
448 |
+
|
449 |
st.pyplot(fig) # Display the plot in the Streamlit app
|
450 |
|
451 |
# call openai to pick the best classification result based on query
|