Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import subprocess
|
|
7 |
subprocess_executed = False
|
8 |
|
9 |
# Function to install dependencies
|
10 |
-
@st.
|
11 |
def install_dependencies():
|
12 |
command = "chmod +x install.sh"
|
13 |
subprocess.run(command, shell=True, check=True)
|
@@ -16,7 +16,7 @@ def install_dependencies():
|
|
16 |
subprocess.run(command, shell=True, check=True)
|
17 |
|
18 |
# Function to run inference
|
19 |
-
@st.
|
20 |
def run_inference():
|
21 |
command = "chmod +x inference.sh"
|
22 |
subprocess.run(command, shell=True, check=True)
|
@@ -76,6 +76,15 @@ def main():
|
|
76 |
if os.path.exists(video_path) and os.path.exists(image_path) and os.path.exists(largest_slice):
|
77 |
zip_filename = os.path.join(temp_dir, "outputs.zip")
|
78 |
zip_and_download(temp_dicom_dir_path, zip_filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
else:
|
80 |
st.error("Output files not found.")
|
81 |
else:
|
|
|
7 |
subprocess_executed = False
|
8 |
|
9 |
# Function to install dependencies
|
10 |
+
@st.cache_resource
|
11 |
def install_dependencies():
|
12 |
command = "chmod +x install.sh"
|
13 |
subprocess.run(command, shell=True, check=True)
|
|
|
16 |
subprocess.run(command, shell=True, check=True)
|
17 |
|
18 |
# Function to run inference
|
19 |
+
@st.cache_resource
|
20 |
def run_inference():
|
21 |
command = "chmod +x inference.sh"
|
22 |
subprocess.run(command, shell=True, check=True)
|
|
|
76 |
if os.path.exists(video_path) and os.path.exists(image_path) and os.path.exists(largest_slice):
|
77 |
zip_filename = os.path.join(temp_dir, "outputs.zip")
|
78 |
zip_and_download(temp_dicom_dir_path, zip_filename)
|
79 |
+
|
80 |
+
st.title("Largest Slice")
|
81 |
+
st.image(largest_slice, use_column_width=True)
|
82 |
+
|
83 |
+
st.title("Video")
|
84 |
+
st.video(video_path, format="video/mp4")
|
85 |
+
|
86 |
+
st.title("Diameter Graph")
|
87 |
+
st.image(image_path, use_column_width=True)
|
88 |
else:
|
89 |
st.error("Output files not found.")
|
90 |
else:
|