Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ def cut_n_predict(data, wcs, scale):
|
|
96 |
|
97 |
# Define function to decompose prediction into individual cavities
|
98 |
@st.cache
|
99 |
-
def decompose_cavity(pred, th2=0.7, amin=
|
100 |
X, Y = pred.nonzero()
|
101 |
data = np.array([X,Y]).reshape(2, -1)
|
102 |
|
@@ -113,8 +113,8 @@ def decompose_cavity(pred, th2=0.7, amin=10):
|
|
113 |
xi, yi = X[b], Y[b]
|
114 |
img[xi, yi] = pred[xi, yi]
|
115 |
|
116 |
-
# Thresholding #2
|
117 |
-
if not (img > th2).any(): continue
|
118 |
|
119 |
# Minimal area
|
120 |
if np.sum(img) <= amin: continue
|
|
|
96 |
|
97 |
# Define function to decompose prediction into individual cavities
|
98 |
@st.cache
|
99 |
+
def decompose_cavity(pred, th2=0.7, amin=6):
|
100 |
X, Y = pred.nonzero()
|
101 |
data = np.array([X,Y]).reshape(2, -1)
|
102 |
|
|
|
113 |
xi, yi = X[b], Y[b]
|
114 |
img[xi, yi] = pred[xi, yi]
|
115 |
|
116 |
+
# # Thresholding #2
|
117 |
+
# if not (img > th2).any(): continue
|
118 |
|
119 |
# Minimal area
|
120 |
if np.sum(img) <= amin: continue
|