jeysshon commited on
Commit
144f1f9
·
verified ·
1 Parent(s): fc785fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -6,8 +6,8 @@ from keras.models import load_model
6
  import tensorflow as tf
7
  from tensorflow import keras
8
 
9
- # Cargar el nuevo 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
- # Convertir mapa de calor a RGB
74
  heatmap = np.uint8(255 * heatmap)
75
- heatmap = cv2.applyColorMap(heatmap, cv2.COLORMAP_JET)
76
  # Convertir imagen a BGR
77
  img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
78
  # Aplicar mapa de calor a la imagen original
 
6
  import tensorflow as tf
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 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