Vishu26 commited on
Commit
34da2e5
·
1 Parent(s): 435a5b8
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -4,6 +4,7 @@ import torch
4
  import torch.nn as nn
5
  from einops import rearrange
6
  import matplotlib.pyplot as plt
 
7
 
8
  pred_global = None
9
 
@@ -104,10 +105,11 @@ def text_fn(taxon, name):
104
 
105
  def thresh_fn(val):
106
  global pred_global
107
- pred_global = pred_global > val
 
108
  cmap = plt.get_cmap('Greens')
109
 
110
- rgba_img = cmap(pred_global)
111
  rgb_img = np.delete(rgba_img, 3, 2)
112
  return rgb_img
113
 
 
4
  import torch.nn as nn
5
  from einops import rearrange
6
  import matplotlib.pyplot as plt
7
+ from copy import deepcopy
8
 
9
  pred_global = None
10
 
 
105
 
106
  def thresh_fn(val):
107
  global pred_global
108
+ preds = deepcopy(pred_global)
109
+ preds = preds > val
110
  cmap = plt.get_cmap('Greens')
111
 
112
+ rgba_img = cmap(preds)
113
  rgb_img = np.delete(rgba_img, 3, 2)
114
  return rgb_img
115