Spaces:
Running
Running
Upload 1_Classification.py
Browse files
pages/1_Classification.py
CHANGED
|
@@ -86,11 +86,11 @@ if uploaded_file:
|
|
| 86 |
model = load_model(path)
|
| 87 |
predictions = model.predict(img_array, verbose=0)[0]
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
-
st.markdown(f"### {model_name} - Top
|
| 92 |
|
| 93 |
-
for idx in
|
| 94 |
class_name = CLASS_NAMES[idx]
|
| 95 |
confidence = predictions[idx]
|
| 96 |
st.write(f"{class_name} — {confidence:.3f}")
|
|
|
|
| 86 |
model = load_model(path)
|
| 87 |
predictions = model.predict(img_array, verbose=0)[0]
|
| 88 |
|
| 89 |
+
top10_indices = np.argsort(predictions)[-10:][::-1]
|
| 90 |
|
| 91 |
+
st.markdown(f"### {model_name} - Top 10 Predictions")
|
| 92 |
|
| 93 |
+
for idx in top10_indices:
|
| 94 |
class_name = CLASS_NAMES[idx]
|
| 95 |
confidence = predictions[idx]
|
| 96 |
st.write(f"{class_name} — {confidence:.3f}")
|