Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def prediction(file):
|
|
34 |
|
35 |
# file uploader
|
36 |
|
37 |
-
uploaded_file = st.file_uploader("
|
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 |
-
|
49 |
-
|
|
|
|
|
|
|
|
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))
|