Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,6 @@ st.set_page_config(page_title="Cavity Detection Tool", layout="wide")
|
|
28 |
# st.title("Cavity Detection Tool")
|
29 |
|
30 |
# Define function to plot the uploaded image
|
31 |
-
@st.cache
|
32 |
def plot_image(image, scale):
|
33 |
plt.figure(figsize=(4, 4))
|
34 |
x0 = image.shape[0] // 2 - scale * 128 / 2
|
@@ -38,7 +37,6 @@ def plot_image(image, scale):
|
|
38 |
with colA: st.pyplot()
|
39 |
|
40 |
# Define function to plot the prediction
|
41 |
-
@st.cache
|
42 |
def plot_prediction(pred):
|
43 |
plt.figure(figsize=(4, 4))
|
44 |
plt.imshow(pred, origin="lower")
|
@@ -99,6 +97,7 @@ def cut_n_predict(data, wcs, scale):
|
|
99 |
return y_pred, wcs
|
100 |
|
101 |
# Define function to decomposed prediction into cavities
|
|
|
102 |
def decompose_cavity(pred, th2=0.7, amin=10):
|
103 |
X, Y = pred.nonzero()
|
104 |
data = np.array([X,Y]).reshape(2, -1)
|
|
|
28 |
# st.title("Cavity Detection Tool")
|
29 |
|
30 |
# Define function to plot the uploaded image
|
|
|
31 |
def plot_image(image, scale):
|
32 |
plt.figure(figsize=(4, 4))
|
33 |
x0 = image.shape[0] // 2 - scale * 128 / 2
|
|
|
37 |
with colA: st.pyplot()
|
38 |
|
39 |
# Define function to plot the prediction
|
|
|
40 |
def plot_prediction(pred):
|
41 |
plt.figure(figsize=(4, 4))
|
42 |
plt.imshow(pred, origin="lower")
|
|
|
97 |
return y_pred, wcs
|
98 |
|
99 |
# Define function to decomposed prediction into cavities
|
100 |
+
@st.cache
|
101 |
def decompose_cavity(pred, th2=0.7, amin=10):
|
102 |
X, Y = pred.nonzero()
|
103 |
data = np.array([X,Y]).reshape(2, -1)
|