Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -243,6 +243,9 @@ def classifyImage(input_image):
|
|
243 |
probability_sum = predictions.sum() * 100
|
244 |
print(f"Sum of predictions (as percentages): {probability_sum:.2f}%")
|
245 |
|
|
|
|
|
|
|
246 |
# Sort predictions to get top 5
|
247 |
top_indices = np.argsort(predictions)[-5:][::-1]
|
248 |
|
|
|
243 |
probability_sum = predictions.sum() * 100
|
244 |
print(f"Sum of predictions (as percentages): {probability_sum:.2f}%")
|
245 |
|
246 |
+
for i, confidence in enumerate(predictions):
|
247 |
+
print(f"Class {i} has {confidence*100:.2f}% confidence")
|
248 |
+
|
249 |
# Sort predictions to get top 5
|
250 |
top_indices = np.argsort(predictions)[-5:][::-1]
|
251 |
|