marahim20-2 commited on
Commit
4464ff1
·
verified ·
1 Parent(s): d516860

Hid the image as soon as it is uploaded

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -62,7 +62,7 @@ def main():
62
  if uploaded_file is not None:
63
  # Display uploaded image
64
  image = Image.open(io.BytesIO(uploaded_file.read()))
65
- st.image(image, caption="Uploaded Image", use_column_width=True)
66
 
67
  # Load model
68
  model = load_model()
@@ -76,7 +76,7 @@ def main():
76
  )
77
  if predict_button:
78
  # Display processing message with spinner
79
- with st.spinner("Please wait...Processing the image and predicting..."):
80
  # Preprocess image
81
  processed_image = preprocess_image(image)
82
 
@@ -94,7 +94,7 @@ def main():
94
  st.image(explanation_image, caption="Explanation Image", use_column_width=True)
95
 
96
  # Display prediction
97
- st.subheader("Prediction:")
98
  st.write(f"Predicted Class: {predicted_class}")
99
  st.write(f"Confidence Score: {confidence_score}%")
100
 
 
62
  if uploaded_file is not None:
63
  # Display uploaded image
64
  image = Image.open(io.BytesIO(uploaded_file.read()))
65
+ # st.image(image, caption="Uploaded Image", use_column_width=True)
66
 
67
  # Load model
68
  model = load_model()
 
76
  )
77
  if predict_button:
78
  # Display processing message with spinner
79
+ with st.spinner(" Please wait... Processing the image and predicting..."):
80
  # Preprocess image
81
  processed_image = preprocess_image(image)
82
 
 
94
  st.image(explanation_image, caption="Explanation Image", use_column_width=True)
95
 
96
  # Display prediction
97
+ st.subheader("Prediction")
98
  st.write(f"Predicted Class: {predicted_class}")
99
  st.write(f"Confidence Score: {confidence_score}%")
100