From 53ef2fd8178d651fb2c0273a99507063e4e27cd3 Mon Sep 17 00:00:00 2001 From: msp259 Date: Sun, 3 Dec 2023 12:36:48 -0500 Subject: [PATCH] res --- src/view/app.py | 56 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/view/app.py b/src/view/app.py index 96a2505c..da22fb7f 100644 --- a/src/view/app.py +++ b/src/view/app.py @@ -143,34 +143,34 @@ def results_page(): if st.session_state.processed_video: st.video(open(st.session_state.processed_video, "rb").read()) -st.markdown("## Statistics") - -try: - with open("tmp/results.txt", "r") as file: - results_data = file.readlines() - - current_section = None - results_table = [] - - # Process each line in the file - for line in results_data: - line = line.strip() - if line.endswith(":"): # Check if the line is a section header - if results_table: # Display the previous section's table, if any - st.markdown(f"### {current_section}") - st.table(results_table) - results_table = [] # Reset for the next section - current_section = line[:-1] # Set the new section header - elif ": " in line: - results_table.append(line.split(": ")) - - # Display the last section's table - if results_table: - st.markdown(f"### {current_section}") - st.table(results_table) - -except FileNotFoundError: - st.error("Results file not found.") + st.markdown("## Statistics") + + try: + with open("tmp/results.txt", "r") as file: + results_data = file.readlines() + + current_section = None + results_table = [] + + # Process each line in the file + for line in results_data: + line = line.strip() + if line.endswith(":"): # Check if the line is a section header + if results_table: # Display the previous section's table, if any + st.markdown(f"### {current_section}") + st.table(results_table) + results_table = [] # Reset for the next section + current_section = line[:-1] # Set the new section header + elif ": " in line: + results_table.append(line.split(": ")) + + # Display the last section's table + if results_table: + st.markdown(f"### {current_section}") + st.table(results_table) + + except FileNotFoundError: + st.error("Results file not found.") st.markdown("## MiniMap") try: video_file_path = 'tmp/minimap.mp4'