Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import cv2
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
import tensorflow as tf
|
|
|
5 |
from huggingface_hub.keras_mixin import from_pretrained_keras
|
6 |
from PIL import Image
|
7 |
|
@@ -46,7 +47,7 @@ def show_plot(image):
|
|
46 |
heatmap = np.float32(heatmap)
|
47 |
|
48 |
saliency_map = heatmap + original_image
|
49 |
-
saliency_map = np.clip(saliency_map, 0.0, 255.0).astype(
|
50 |
return Image.fromarray(saliency_map)
|
51 |
|
52 |
|
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
import tensorflow as tf
|
5 |
+
|
6 |
from huggingface_hub.keras_mixin import from_pretrained_keras
|
7 |
from PIL import Image
|
8 |
|
|
|
47 |
heatmap = np.float32(heatmap)
|
48 |
|
49 |
saliency_map = heatmap + original_image
|
50 |
+
saliency_map = np.clip(saliency_map, 0.0, 255.0).astype(np.uint8)
|
51 |
return Image.fromarray(saliency_map)
|
52 |
|
53 |
|