Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
10 |
-
model1 = load_model('./
|
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 |
-
#
|
74 |
heatmap = np.uint8(255 * heatmap)
|
75 |
-
heatmap = cv2.applyColorMap(heatmap, cv2.
|
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
|