ariG23498 HF staff commited on
Commit
85a0494
1 Parent(s): 87eb18f

chore: final

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. utils.py +1 -1
app.py CHANGED
@@ -43,8 +43,9 @@ with st.spinner("Generating the heat maps... HOLD ON!"):
43
  image=preprocessed_img_orig
44
  )
45
 
46
- plt = utils.plot(attentions=attentions, image=preprocessed_img_orig)
47
 
48
  # Show the attention maps
49
  st.title("Attention 🔥 Maps")
50
- st.image(plt, caption="Attention Heat Maps")
 
 
43
  image=preprocessed_img_orig
44
  )
45
 
46
+ utils.plot(attentions=attentions, image=preprocessed_img_orig)
47
 
48
  # Show the attention maps
49
  st.title("Attention 🔥 Maps")
50
+ image = Image.open("heat_map.png")
51
+ st.image(image, caption="Attention Heat Maps")
utils.py CHANGED
@@ -97,4 +97,4 @@ def plot(attentions, image):
97
  img_count += 1
98
 
99
  plt.tight_layout()
100
- return plt
 
97
  img_count += 1
98
 
99
  plt.tight_layout()
100
+ plt.savefig("heat_map.png")