Dusduo commited on
Commit
9b3cd13
·
1 Parent(s): 00341ad

Update model's response in case of non classification

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -135,14 +135,18 @@ if st.sidebar.button("Click Here to Classify"):
135
  time.sleep(2)
136
  st.sidebar.success('Done!')
137
 
138
- st.sidebar.header("Model predicts: ")
139
 
140
  # Display prediction
141
 
142
  if probability==-1:
143
 
144
- st.sidebar.write("It seems like it is not a picture of a 1st Generation Pokemon alone.", '\n',
145
- "There might be too many entities on the image." )
 
 
 
 
146
 
147
  else:
148
  st.sidebar.write(f" It's a(n) <b>{prediction}</b> picture.",'\n', unsafe_allow_html=True)
 
135
  time.sleep(2)
136
  st.sidebar.success('Done!')
137
 
138
+ st.sidebar.header("Model response: ")
139
 
140
  # Display prediction
141
 
142
  if probability==-1:
143
 
144
+ st.sidebar.write("""I am sorry I am having trouble finding a matching pokemon. <br>
145
+ <b>Potential explanations: </b><br>
146
+ - The image provided is a Pokemon but not from the 1st Generation. <br>
147
+ - The image provided is not a Pokemon. <br>
148
+ - There are too many entities on the image. <br>
149
+ """, unsafe_allow_html=True)
150
 
151
  else:
152
  st.sidebar.write(f" It's a(n) <b>{prediction}</b> picture.",'\n', unsafe_allow_html=True)