sayakpaul HF staff commited on
Commit
b0daa79
1 Parent(s): 486cd38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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("int32")
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