import streamlit as st import sys import os import matplotlib.pyplot as plt import matplotlib.patches as patches import torch import numpy as np import threading import hmac from processing.surface_plots import surface_plot from processing.preprocessing import plot_timeseries from processing.prediction import NN_prediction from processing.classification_model import classify from processing.barsplots_rootcauses import check_classification from processing.cloud_access import auto_download sprint_data_folder = "Messungen" seafile_token = os.environ['SEAFILE_TOKEN'] def get_csv_files(data_folder): csv_files = [] for file in os.listdir(data_folder): if file.endswith(".csv"): csv_file = os.path.join(data_folder, file) csv_files.append(csv_file) return csv_files def check_password(): """Returns `True` if the user had the correct password.""" def password_entered(): """Checks whether a password entered by the user is correct.""" if hmac.compare_digest(st.session_state["password"], st.secrets["password"]): st.session_state["password_correct"] = True del st.session_state["password"] # Don't store the password. else: st.session_state["password_correct"] = False # Return True if the password is validated. if st.session_state.get("password_correct", False): return True # Show input for password. st.text_input( "Password", type="password", on_change=password_entered, key="password" ) if "password_correct" in st.session_state: st.error("😕 Password incorrect") return False if not check_password(): st.stop() # Do not continue if check_password is not True. def main(): sprint_csv_files = get_csv_files(sprint_data_folder) st.set_page_config(page_title="Assistenzsystem", page_icon=":eyeglasses:", layout="wide") with open("assets/style.css") as f: st.markdown(f"", unsafe_allow_html=True) st.write("") col1, col2 = st.columns([1, 0.2]) with col1: st.image("assets/ProKI_Logo.png", width=200) with col2: st.image("assets/qr-code.png", width=100) #with col2: st.markdown("