Vishu26 commited on
Commit
ec04505
·
1 Parent(s): d8d0a27
Files changed (2) hide show
  1. app.py +5 -0
  2. stl_base.png +0 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import numpy as np
3
  import matplotlib.pyplot as plt
4
  from copy import deepcopy
5
  import pandas as pd
 
6
 
7
 
8
  def get_index_of_element_containing_word(lst, word):
@@ -19,6 +20,8 @@ obs = df.drop_duplicates(subset=["species"])["species"].tolist()
19
  obs = list(sorted(obs))
20
  del df
21
 
 
 
22
 
23
  def update_fn(val):
24
  if val=="Class":
@@ -43,6 +46,8 @@ def text_fn(taxon, name):
43
 
44
  rgba_img = cmap(preds)
45
  rgb_img = np.delete(rgba_img, 3, 2)
 
 
46
  #return gr.Image(preds, label="Predicted Heatmap", visible=True)
47
  return rgb_img
48
 
 
3
  import matplotlib.pyplot as plt
4
  from copy import deepcopy
5
  import pandas as pd
6
+ from PIL import Image
7
 
8
 
9
  def get_index_of_element_containing_word(lst, word):
 
20
  obs = list(sorted(obs))
21
  del df
22
 
23
+ stl_base = Image.open("stl_base.png").convert("RGB")
24
+
25
 
26
  def update_fn(val):
27
  if val=="Class":
 
46
 
47
  rgba_img = cmap(preds)
48
  rgb_img = np.delete(rgba_img, 3, 2)
49
+ blend = Image.blend(stl_base, Image.fromarray((rgb_img * 255).astype(np.uint8)), 0.5)
50
+ rgb_img = np.array(blend)
51
  #return gr.Image(preds, label="Predicted Heatmap", visible=True)
52
  return rgb_img
53
 
stl_base.png ADDED