Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -239,7 +239,7 @@ def classifyImage(input_image):
|
|
239 |
print(f"Predictions: {predictions}")
|
240 |
|
241 |
# Sort predictions to get top 5
|
242 |
-
top_indices = np.argsort(predictions)[-5:]
|
243 |
|
244 |
# Prepare the top 5 predictions with their class names and percentages
|
245 |
top_predictions = [(class_names[i], predictions[i] * 100) for i in top_indices]
|
|
|
239 |
print(f"Predictions: {predictions}")
|
240 |
|
241 |
# Sort predictions to get top 5
|
242 |
+
top_indices = np.argsort(predictions)[-5:]
|
243 |
|
244 |
# Prepare the top 5 predictions with their class names and percentages
|
245 |
top_predictions = [(class_names[i], predictions[i] * 100) for i in top_indices]
|