tonyliu404 commited on
Commit
5f58b73
·
verified ·
1 Parent(s): 7a85143

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -408,7 +408,7 @@ if recipe_submit and uploaded_image:
408
  fpredictions = ""
409
  class_names = []
410
  confidences = []
411
- MIN_CONFIDENCE = 5 # 5%
412
 
413
  # Show the top predictions with percentages
414
  # st.write("Top Predictions:")
@@ -430,7 +430,7 @@ if recipe_submit and uploaded_image:
430
  norm = plt.Normalize(min(confidences), max(confidences))
431
  cmap = LinearSegmentedColormap.from_list("grey_orange", ["#808080", "#FFA500"]) #color map grey to orange
432
 
433
- fig, ax = plt.subplots(figsize=(8, 6))
434
  bars = ax.barh(class_names, confidences, color=cmap(norm(confidences)))
435
 
436
  fig.patch.set_alpha(0) # Transparent background
@@ -449,7 +449,7 @@ if recipe_submit and uploaded_image:
449
  for spine in ax.spines.values():
450
  spine.set_visible(False)
451
 
452
- ax.set_title(class_names[0], color='white', fontsize=16, fontweight='bold', ha='center')
453
 
454
  st.pyplot(fig) # Display the plot
455
 
 
408
  fpredictions = ""
409
  class_names = []
410
  confidences = []
411
+ MIN_CONFIDENCE = 7 # 7%
412
 
413
  # Show the top predictions with percentages
414
  # st.write("Top Predictions:")
 
430
  norm = plt.Normalize(min(confidences), max(confidences))
431
  cmap = LinearSegmentedColormap.from_list("grey_orange", ["#808080", "#FFA500"]) #color map grey to orange
432
 
433
+ fig, ax = plt.subplots(figsize=(10, 6))
434
  bars = ax.barh(class_names, confidences, color=cmap(norm(confidences)))
435
 
436
  fig.patch.set_alpha(0) # Transparent background
 
449
  for spine in ax.spines.values():
450
  spine.set_visible(False)
451
 
452
+ ax.set_title(class_names[-1], color='white', fontsize=16, fontweight='bold', ha='center')
453
 
454
  st.pyplot(fig) # Display the plot
455