Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,11 +57,7 @@ if uploaded_file is not None:
|
|
| 57 |
with st.spinner("Classifying..."):
|
| 58 |
results = classifier(image)
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
#top 4 results
|
| 63 |
-
|
| 64 |
-
if results:
|
| 65 |
st.subheader("Top Predictions:")
|
| 66 |
for result in results[:4]:
|
| 67 |
st.write(f"**{result['label']}** - {result['score'] * 100:.2f}%")
|
|
@@ -70,7 +66,7 @@ if uploaded_file is not None:
|
|
| 70 |
confidence = results[0]['score'] * 100
|
| 71 |
st.success(f"**Most Likely Prediction:** {label}")
|
| 72 |
st.info(f"**Confidence:** {confidence:.2f}%")
|
| 73 |
-
|
| 74 |
st.warning("⚠️ Internet Issue. Please try another image.")
|
| 75 |
# Option to classify another image
|
| 76 |
st.button("Classify Another Image", on_click=lambda: st.experimental_rerun())
|
|
|
|
| 57 |
with st.spinner("Classifying..."):
|
| 58 |
results = classifier(image)
|
| 59 |
|
| 60 |
+
if results:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
st.subheader("Top Predictions:")
|
| 62 |
for result in results[:4]:
|
| 63 |
st.write(f"**{result['label']}** - {result['score'] * 100:.2f}%")
|
|
|
|
| 66 |
confidence = results[0]['score'] * 100
|
| 67 |
st.success(f"**Most Likely Prediction:** {label}")
|
| 68 |
st.info(f"**Confidence:** {confidence:.2f}%")
|
| 69 |
+
else:
|
| 70 |
st.warning("⚠️ Internet Issue. Please try another image.")
|
| 71 |
# Option to classify another image
|
| 72 |
st.button("Classify Another Image", on_click=lambda: st.experimental_rerun())
|