AdritRao commited on
Commit
acda587
·
1 Parent(s): 843bd63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -4,6 +4,7 @@ import matplotlib.pyplot as plt
4
  import zipfile
5
  import os
6
  import subprocess
 
7
 
8
  # Flag to track if subprocess commands have been executed
9
  subprocess_executed = False
@@ -90,6 +91,18 @@ if uploaded_zip_file is not None:
90
  # Set the flag to indicate that subprocess commands have been executed
91
  subprocess_executed = True
92
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  except Exception as e:
94
  st.error(f"Error: {str(e)}")
95
  finally:
 
4
  import zipfile
5
  import os
6
  import subprocess
7
+ from datetime import datetime
8
 
9
  # Flag to track if subprocess commands have been executed
10
  subprocess_executed = False
 
91
  # Set the flag to indicate that subprocess commands have been executed
92
  subprocess_executed = True
93
 
94
+ current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
95
+ video_path = f"/home/user/app/C2C/comp2comp/outputs/{current_datetime}/temp_dicom_dir/images/summary/aaa.mp4"
96
+ image_path = f"/home/user/app/C2C/comp2comp/outputs/{current_datetime}/temp_dicom_dir/images/summary/diameter_graph.png"
97
+
98
+ # Display the video generated by the inference script
99
+ if os.path.exists(video_path):
100
+ st.video(video_path, format="video/mp4")
101
+
102
+ # Display the image generated by the inference script
103
+ if os.path.exists(image_path):
104
+ st.image(image_path, caption="Diameter Graph", use_column_width=True)
105
+
106
  except Exception as e:
107
  st.error(f"Error: {str(e)}")
108
  finally: