Spaces:
Running
Running
Update app.py
Browse files
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,
|
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 |
)
|