jeysshon commited on
Commit
af15e50
·
verified ·
1 Parent(s): 20d3710

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,7 +7,7 @@ import tensorflow as tf
7
  from tensorflow import keras
8
 
9
  # Cargar el modelo entrenado
10
- model1 = load_model('./isatron_v3.h5')
11
 
12
  # Función para encontrar la última capa convolucional
13
  def find_last_conv_layer(model):
@@ -70,9 +70,9 @@ def make_gradcam_heatmap(img_array, model, last_conv_layer_name, pred_index=None
70
  def overlay_heatmap(heatmap, img, alpha=0.4):
71
  # Redimensionar mapa de calor al tamaño de la imagen
72
  heatmap = cv2.resize(heatmap, (img.shape[1], img.shape[0]))
73
- # Aplicar un colormap que no contenga amarillo, como VIRIDIS
74
  heatmap = np.uint8(255 * heatmap)
75
- heatmap = cv2.applyColorMap(heatmap, cv2.COLORMAP_VIRIDIS) # Cambiado a VIRIDIS
76
  # Convertir imagen a BGR
77
  img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
78
  # Aplicar mapa de calor a la imagen original
 
7
  from tensorflow import keras
8
 
9
  # Cargar el modelo entrenado
10
+ model1 = load_model('./modelo_isatron_jeysshonl.h5')
11
 
12
  # Función para encontrar la última capa convolucional
13
  def find_last_conv_layer(model):
 
70
  def overlay_heatmap(heatmap, img, alpha=0.4):
71
  # Redimensionar mapa de calor al tamaño de la imagen
72
  heatmap = cv2.resize(heatmap, (img.shape[1], img.shape[0]))
73
+ # Aplicar el colormap RAINBOW para obtener colores más vivos
74
  heatmap = np.uint8(255 * heatmap)
75
+ heatmap = cv2.applyColorMap(heatmap, cv2.COLORMAP_RAINBOW) # Cambiado a RAINBOW
76
  # Convertir imagen a BGR
77
  img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
78
  # Aplicar mapa de calor a la imagen original