robocan commited on
Commit
35a87f4
·
verified ·
1 Parent(s): 48c50ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -78,13 +78,14 @@ def predict(input_img):
78
 
79
  def create_bar_plot(predictions):
80
  data = pd.DataFrame(list(predictions.items()), columns=["Location", "Probability"])
 
81
  return gr.BarPlot(
82
  data,
83
  x="Location",
84
  y="Probability",
85
  title="Top 10 Predictions with Probabilities",
86
  tooltip=["Location", "Probability"],
87
- y_lim=[0, 1],
88
  width=800, # Set the width of the plot
89
  height=600 # Set the height of the plot
90
  )
 
78
 
79
  def create_bar_plot(predictions):
80
  data = pd.DataFrame(list(predictions.items()), columns=["Location", "Probability"])
81
+ max_prob = data["Probability"].max()
82
  return gr.BarPlot(
83
  data,
84
  x="Location",
85
  y="Probability",
86
  title="Top 10 Predictions with Probabilities",
87
  tooltip=["Location", "Probability"],
88
+ y_lim=[0, max_prob],
89
  width=800, # Set the width of the plot
90
  height=600 # Set the height of the plot
91
  )