Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ uploaded_files = st.file_uploader(
|
|
31 |
accept_multiple_files=True,
|
32 |
key=state['file_uploader_key'])
|
33 |
|
34 |
-
if
|
35 |
st.image(uploaded_files, width=100)
|
36 |
state["uploaded_files"] = uploaded_files
|
37 |
if st.button("Generate prediction"):
|
@@ -44,10 +44,9 @@ if state['uploaded_files'] == []:
|
|
44 |
predictions = model.predict(processed_image)
|
45 |
score = predictions[0]
|
46 |
st.markdown("Predicted class of the image {} is : {}".format(file, class_names[np.argmax(score)]))
|
47 |
-
|
48 |
-
|
49 |
if st.button("Clear uploaded files"):
|
50 |
state["file_uploader_key"] += 1
|
51 |
-
|
52 |
#st.experimental_rerun()
|
53 |
|
|
|
31 |
accept_multiple_files=True,
|
32 |
key=state['file_uploader_key'])
|
33 |
|
34 |
+
if uploaded_files:
|
35 |
st.image(uploaded_files, width=100)
|
36 |
state["uploaded_files"] = uploaded_files
|
37 |
if st.button("Generate prediction"):
|
|
|
44 |
predictions = model.predict(processed_image)
|
45 |
score = predictions[0]
|
46 |
st.markdown("Predicted class of the image {} is : {}".format(file, class_names[np.argmax(score)]))
|
47 |
+
|
|
|
48 |
if st.button("Clear uploaded files"):
|
49 |
state["file_uploader_key"] += 1
|
50 |
+
uploaded_files = None
|
51 |
#st.experimental_rerun()
|
52 |
|