Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,10 +43,15 @@ if uploaded_image is not None:
|
|
| 43 |
st.write("Classifying...")
|
| 44 |
|
| 45 |
predictions = predict_pokemon(image)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
# Display predictions as a pie chart
|
| 48 |
-
st.write("### Prediction Chart")
|
| 49 |
-
fig, ax = plt.subplots()
|
| 50 |
-
ax.pie(df["Probability"], labels=df["Pokemon"], autopct='%1.1f%%', colors=plt.cm.Paired.colors)
|
| 51 |
-
ax.set_title('Prediction Probabilities')
|
| 52 |
-
st.pyplot(fig)
|
|
|
|
| 43 |
st.write("Classifying...")
|
| 44 |
|
| 45 |
predictions = predict_pokemon(image)
|
| 46 |
+
|
| 47 |
+
# Display predictions as a DataFrame
|
| 48 |
+
st.write("### Prediction Probabilities")
|
| 49 |
+
df = pd.DataFrame(predictions.items(), columns=["Pokemon", "Probability"])
|
| 50 |
+
st.dataframe(df)
|
| 51 |
|
| 52 |
+
# Display predictions as a pie chart
|
| 53 |
+
st.write("### Prediction Chart")
|
| 54 |
+
fig, ax = plt.subplots()
|
| 55 |
+
ax.pie(df["Probability"], labels=df["Pokemon"], autopct='%1.1f%%', colors=plt.cm.Paired.colors)
|
| 56 |
+
ax.set_title('Prediction Probabilities')
|
| 57 |
+
st.pyplot(fig)
|