Update app.py
Browse files
app.py
CHANGED
|
@@ -28,6 +28,7 @@ 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 |
def plot_image(image, scale):
|
| 32 |
plt.figure(figsize=(4, 4))
|
| 33 |
x0 = image.shape[0] // 2 - scale * 128 / 2
|
|
@@ -37,6 +38,7 @@ def plot_image(image, scale):
|
|
| 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")
|
|
|
|
| 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 |
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")
|