Kalbe-x-Bangkit commited on
Commit
9b4ee41
1 Parent(s): 112dfd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -497,7 +497,11 @@ if uploaded_file is not None:
497
 
498
  with col3:
499
  if st.button('Generate Grad-CAM'):
 
500
  model = load_model()
501
  # Compute and show Grad-CAM
502
  st.write("Generating Grad-CAM visualizations")
503
- compute_gradcam(model, uploaded_file)
 
 
 
 
497
 
498
  with col3:
499
  if st.button('Generate Grad-CAM'):
500
+ st.write("Loading model...")
501
  model = load_model()
502
  # Compute and show Grad-CAM
503
  st.write("Generating Grad-CAM visualizations")
504
+ try:
505
+ compute_gradcam(model, uploaded_file)
506
+ except Exception as e:
507
+ st.error(f"Error generating Grad-CAM: {e}")