AdritRao commited on
Commit
9eed4fa
·
1 Parent(s): 2e8eeaf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -29
app.py CHANGED
@@ -14,30 +14,6 @@ from tkinter import Tcl
14
  # Flag to track if subprocess commands have been executed
15
  subprocess_executed = False
16
 
17
- # Title with superscript and subtitle
18
- st.markdown(
19
- """
20
- <style>
21
- .reportview-container {
22
- background: white;
23
- }
24
- </style>
25
- """,
26
- unsafe_allow_html=True,
27
- )
28
-
29
- # Set a custom background color for the header
30
- st.markdown(
31
- """
32
- <style>
33
- .reportview-container .main .block-container {
34
- background: red;
35
- }
36
- </style>
37
- """,
38
- unsafe_allow_html=True,
39
- )
40
-
41
  # Title with superscript and subtitle
42
  st.markdown("""
43
  <div style='text-align: center;'>
@@ -51,8 +27,10 @@ st.markdown("""
51
  """, unsafe_allow_html=True)
52
 
53
  # Upload a ZIP file containing DICOM slices
54
- uploaded_zip_file = st.file_uploader("Upload a ZIP file containing DICOM slices", type=["zip"])
55
- st.write("Upload a ZIP file containing DICOM slices to view the images.")
 
 
56
 
57
  @st.cache_resource
58
  def install_dependencies():
@@ -88,9 +66,7 @@ def run_inference():
88
  print(f"Error while running the script: {e}")
89
 
90
  if uploaded_zip_file is not None:
91
- try:
92
- install_dependencies()
93
-
94
  temp_dir = "/home/user/app/C2C/temp_dicom_dir"
95
 
96
  os.makedirs(temp_dir, exist_ok=True)
@@ -109,6 +85,10 @@ if uploaded_zip_file is not None:
109
  st.error(f"Error: {str(e)}")
110
 
111
  if st.button("Analyze"):
 
 
 
 
112
  run_inference()
113
 
114
  # Assuming the 'outputs' directory is located at "/home/user/app/C2C/comp2comp/outputs"
 
14
  # Flag to track if subprocess commands have been executed
15
  subprocess_executed = False
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  # Title with superscript and subtitle
18
  st.markdown("""
19
  <div style='text-align: center;'>
 
27
  """, unsafe_allow_html=True)
28
 
29
  # Upload a ZIP file containing DICOM slices
30
+ st.write("Upload a ZIP file containing DICOM slices")
31
+ uploaded_zip_file = st.file_uploader("Upload a .zip file", type=["zip"])
32
+
33
+ st.success("Zip file uploaded successfully")
34
 
35
  @st.cache_resource
36
  def install_dependencies():
 
66
  print(f"Error while running the script: {e}")
67
 
68
  if uploaded_zip_file is not None:
69
+ try:
 
 
70
  temp_dir = "/home/user/app/C2C/temp_dicom_dir"
71
 
72
  os.makedirs(temp_dir, exist_ok=True)
 
85
  st.error(f"Error: {str(e)}")
86
 
87
  if st.button("Analyze"):
88
+
89
+ st.success("Analysis started (expected time: 5 mins)")
90
+
91
+ install_dependencies()
92
  run_inference()
93
 
94
  # Assuming the 'outputs' directory is located at "/home/user/app/C2C/comp2comp/outputs"