agayabag commited on
Commit
a8279b1
·
1 Parent(s): 5a38b3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -34,7 +34,7 @@ def prediction(file):
34
 
35
  # file uploader
36
 
37
- uploaded_file = st.file_uploader("Choose a leaf picture:")
38
  if uploaded_file is not None:
39
  image = Image.open(uploaded_file)
40
  image = image.resize((240, 240))
@@ -44,6 +44,9 @@ if uploaded_file is not None:
44
 
45
  # result
46
 
47
- if st.button('Predict'):
48
- result = prediction(uploaded_file)
49
- st.write('This leaf belongs to {} class'.format(result))
 
 
 
 
34
 
35
  # file uploader
36
 
37
+ uploaded_file = st.file_uploader("Upload your leaf picture.")
38
  if uploaded_file is not None:
39
  image = Image.open(uploaded_file)
40
  image = image.resize((240, 240))
 
44
 
45
  # result
46
 
47
+ if st.button('Predict'):
48
+ if uploaded_file is None:
49
+ st.write('Please upload a leaf picture first.')
50
+ else:
51
+ result = prediction(uploaded_file)
52
+ st.write('This leaf belongs to {} class.'.format(result))