Michael Rey commited on
Commit
d068ca1
·
1 Parent(s): 99d4d0e

enhanced UI

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +10 -6
src/streamlit_app.py CHANGED
@@ -86,12 +86,16 @@ with tab2:
86
  st.image(image, caption="Uploaded Image", width=300)
87
 
88
  input_tensor = preprocess_image(image)
89
- with torch.no_grad():
90
- outputs = model(input_tensor)
91
- _, predicted = torch.max(outputs, 1)
92
- predicted_label = CLASS_NAMES[predicted.item()]
93
- species_name = LABEL_MAP[predicted_label]
94
- st.success(f"Predicted Monkey Species: {species_name}")
 
 
 
 
95
 
96
  # Tab 3: Model details and performance
97
  with tab3:
 
86
  st.image(image, caption="Uploaded Image", width=300)
87
 
88
  input_tensor = preprocess_image(image)
89
+
90
+ # Add spinner to indicate loading
91
+ with st.spinner("Classifying... Please wait."):
92
+ with torch.no_grad():
93
+ outputs = model(input_tensor)
94
+ _, predicted = torch.max(outputs, 1)
95
+ predicted_label = CLASS_NAMES[predicted.item()]
96
+ species_name = LABEL_MAP[predicted_label]
97
+
98
+ st.success(f"Predicted Monkey Species: {species_name}")
99
 
100
  # Tab 3: Model details and performance
101
  with tab3: