Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -293,7 +293,7 @@ def display_dishes_in_grid(dishes, cols=3):
|
|
293 |
|
294 |
def display_prediction_graph(class_names, confidences):
|
295 |
# Create a list of labels and values from the predictions dictionary
|
296 |
-
values = [round(value,
|
297 |
|
298 |
# Determine the top prediction
|
299 |
class_names.reverse()
|
@@ -307,7 +307,7 @@ def display_prediction_graph(class_names, confidences):
|
|
307 |
orientation='h',
|
308 |
marker=dict(color='orange'),
|
309 |
text=values, # Display values on the bars
|
310 |
-
textposition='
|
311 |
))
|
312 |
|
313 |
# Update layout for better appearance
|
|
|
293 |
|
294 |
def display_prediction_graph(class_names, confidences):
|
295 |
# Create a list of labels and values from the predictions dictionary
|
296 |
+
values = [round(value, 1) + "%" for value in confidences]
|
297 |
|
298 |
# Determine the top prediction
|
299 |
class_names.reverse()
|
|
|
307 |
orientation='h',
|
308 |
marker=dict(color='orange'),
|
309 |
text=values, # Display values on the bars
|
310 |
+
textposition='inside' # Position the text inside the bars
|
311 |
))
|
312 |
|
313 |
# Update layout for better appearance
|