data
Browse files
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 |
-
|
|
|
108 |
cmap = plt.get_cmap('Greens')
|
109 |
|
110 |
-
rgba_img = cmap(
|
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 |
|