fahrnphi commited on
Commit
ec34c0d
1 Parent(s): 5b482eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
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)