Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,11 +26,13 @@ model = tf.keras.models.load_model('model')
|
|
26 |
|
27 |
with st.form("form", clear_on_submit=True):
|
28 |
uploaded_file = st.file_uploader("Upload image files", type="jpg", accept_multiple_files=True)
|
29 |
-
submitted = st.form_submit_button("
|
30 |
-
|
|
|
|
|
31 |
if submitted and uploaded_file is not None:
|
32 |
st.write("Predicting!")
|
33 |
-
|
34 |
|
35 |
for file in uploaded_file:
|
36 |
img = Image.open(file)
|
@@ -42,4 +44,6 @@ with st.form("form", clear_on_submit=True):
|
|
42 |
score = predictions[0]
|
43 |
st.markdown("Predicted class of the image {} is : {}".format(file, class_names[np.argmax(score)]))
|
44 |
|
|
|
|
|
45 |
|
|
|
26 |
|
27 |
with st.form("form", clear_on_submit=True):
|
28 |
uploaded_file = st.file_uploader("Upload image files", type="jpg", accept_multiple_files=True)
|
29 |
+
submitted = st.form_submit_button("Click to generate prediction")
|
30 |
+
if uploaded_file is not None:
|
31 |
+
st.image(uploaded_file, width=100)
|
32 |
+
|
33 |
if submitted and uploaded_file is not None:
|
34 |
st.write("Predicting!")
|
35 |
+
|
36 |
|
37 |
for file in uploaded_file:
|
38 |
img = Image.open(file)
|
|
|
44 |
score = predictions[0]
|
45 |
st.markdown("Predicted class of the image {} is : {}".format(file, class_names[np.argmax(score)]))
|
46 |
|
47 |
+
st.write("Click to clear all")
|
48 |
+
uploaded_file = None
|
49 |
|