Kalbe-x-Bangkit commited on
Commit
24201d7
1 Parent(s): 2ed76b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -494,10 +494,10 @@ if uploaded_file is not None:
494
  with col3:
495
  if st.button('Generate Grad-CAM'):
496
  st.write("Loading model...")
497
- model = load_model()
498
  # Compute and show Grad-CAM
499
  st.write("Generating Grad-CAM visualizations")
500
  try:
501
- compute_gradcam(model, uploaded_file)
502
  except Exception as e:
503
  st.error(f"Error generating Grad-CAM: {e}")
 
494
  with col3:
495
  if st.button('Generate Grad-CAM'):
496
  st.write("Loading model...")
497
+ model_gradcam = keras.models.load_model('./gradcam_model.h5')
498
  # Compute and show Grad-CAM
499
  st.write("Generating Grad-CAM visualizations")
500
  try:
501
+ compute_gradcam(model_gradcam, uploaded_file)
502
  except Exception as e:
503
  st.error(f"Error generating Grad-CAM: {e}")