Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,22 +7,22 @@ import subprocess
|
|
7 |
|
8 |
import subprocess
|
9 |
|
10 |
-
# Command to make the script executable
|
11 |
-
command = "chmod +x install.sh"
|
12 |
|
13 |
-
try:
|
14 |
-
|
15 |
-
|
16 |
-
except subprocess.CalledProcessError as e:
|
17 |
-
|
18 |
|
19 |
-
command = "./install.sh"
|
20 |
|
21 |
-
try:
|
22 |
-
|
23 |
-
|
24 |
-
except subprocess.CalledProcessError as e:
|
25 |
-
|
26 |
|
27 |
# Streamlit app title
|
28 |
st.title("DICOM Image Viewer")
|
@@ -50,13 +50,6 @@ if uploaded_zip_file is not None:
|
|
50 |
|
51 |
st.write(f"Temporary directory path: {temp_dir}")
|
52 |
|
53 |
-
command = "./inference.sh"
|
54 |
-
|
55 |
-
try:
|
56 |
-
subprocess.run(command, shell=True, check=True)
|
57 |
-
print("Script 'inference.sh' has started running.")
|
58 |
-
except subprocess.CalledProcessError as e:
|
59 |
-
print(f"Error while making the script executable: {e}")
|
60 |
|
61 |
with zipfile.ZipFile(uploaded_zip_file, "r") as zip_ref:
|
62 |
zip_ref.extractall(temp_dir)
|
@@ -65,6 +58,14 @@ if uploaded_zip_file is not None:
|
|
65 |
dicom_files = [os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith(".dcm")]
|
66 |
dicom_files.sort() # Sort the files
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
if len(dicom_files) == 0:
|
69 |
st.error("No DICOM files found in the ZIP archive.")
|
70 |
else:
|
|
|
7 |
|
8 |
import subprocess
|
9 |
|
10 |
+
# # Command to make the script executable
|
11 |
+
# command = "chmod +x install.sh"
|
12 |
|
13 |
+
# try:
|
14 |
+
# subprocess.run(command, shell=True, check=True)
|
15 |
+
# print("Script 'install.sh' has been made executable.")
|
16 |
+
# except subprocess.CalledProcessError as e:
|
17 |
+
# print(f"Error while making the script executable: {e}")
|
18 |
|
19 |
+
# command = "./install.sh"
|
20 |
|
21 |
+
# try:
|
22 |
+
# subprocess.run(command, shell=True, check=True)
|
23 |
+
# print("Script 'install.sh' has been made executable.")
|
24 |
+
# except subprocess.CalledProcessError as e:
|
25 |
+
# print(f"Error while making the script executable: {e}")
|
26 |
|
27 |
# Streamlit app title
|
28 |
st.title("DICOM Image Viewer")
|
|
|
50 |
|
51 |
st.write(f"Temporary directory path: {temp_dir}")
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
with zipfile.ZipFile(uploaded_zip_file, "r") as zip_ref:
|
55 |
zip_ref.extractall(temp_dir)
|
|
|
58 |
dicom_files = [os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith(".dcm")]
|
59 |
dicom_files.sort() # Sort the files
|
60 |
|
61 |
+
command = "./inference.sh"
|
62 |
+
|
63 |
+
try:
|
64 |
+
subprocess.run(command, shell=True, check=True)
|
65 |
+
print("Script 'inference.sh' has started running.")
|
66 |
+
except subprocess.CalledProcessError as e:
|
67 |
+
print(f"Error while making the script executable: {e}")
|
68 |
+
|
69 |
if len(dicom_files) == 0:
|
70 |
st.error("No DICOM files found in the ZIP archive.")
|
71 |
else:
|