Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,22 @@ def display_dicom_image(selected_slice, dicom_files):
|
|
29 |
if uploaded_zip_file is not None:
|
30 |
try:
|
31 |
# Create a temporary directory to unzip the files
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
os.makedirs(temp_dir, exist_ok=True)
|
34 |
|
35 |
st.write(f"Temporary directory path: {temp_dir}")
|
@@ -52,22 +67,7 @@ if uploaded_zip_file is not None:
|
|
52 |
st.pyplot(plt)
|
53 |
|
54 |
if not subprocess_executed:
|
55 |
-
# Execute the subprocess commands only once
|
56 |
-
command = "chmod +x install.sh"
|
57 |
-
try:
|
58 |
-
subprocess.run(command, shell=True, check=True)
|
59 |
-
print("Script 'install.sh' has been made executable.")
|
60 |
-
except subprocess.CalledProcessError as e:
|
61 |
-
print(f"Error while making the script executable: {e}")
|
62 |
-
|
63 |
-
command = "./install.sh"
|
64 |
-
try:
|
65 |
-
subprocess.run(command, shell=True, check=True)
|
66 |
-
print("Script 'install.sh' has started running.")
|
67 |
-
except subprocess.CalledProcessError as e:
|
68 |
-
print(f"Error while running the script: {e}")
|
69 |
|
70 |
-
|
71 |
command = "chmod +x inference.sh"
|
72 |
|
73 |
try:
|
|
|
29 |
if uploaded_zip_file is not None:
|
30 |
try:
|
31 |
# Create a temporary directory to unzip the files
|
32 |
+
|
33 |
+
command = "chmod +x install.sh"
|
34 |
+
try:
|
35 |
+
subprocess.run(command, shell=True, check=True)
|
36 |
+
print("Script 'install.sh' has been made executable.")
|
37 |
+
except subprocess.CalledProcessError as e:
|
38 |
+
print(f"Error while making the script executable: {e}")
|
39 |
+
|
40 |
+
command = "./install.sh"
|
41 |
+
try:
|
42 |
+
subprocess.run(command, shell=True, check=True)
|
43 |
+
print("Script 'install.sh' has started running.")
|
44 |
+
except subprocess.CalledProcessError as e:
|
45 |
+
print(f"Error while running the script: {e}")
|
46 |
+
|
47 |
+
temp_dir = "/Comp2Comp/temp_dicom_dir"
|
48 |
os.makedirs(temp_dir, exist_ok=True)
|
49 |
|
50 |
st.write(f"Temporary directory path: {temp_dir}")
|
|
|
67 |
st.pyplot(plt)
|
68 |
|
69 |
if not subprocess_executed:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
|
|
71 |
command = "chmod +x inference.sh"
|
72 |
|
73 |
try:
|