Spaces:
Sleeping
Sleeping
File size: 2,378 Bytes
f62b6c1 6b48a2c f62b6c1 6fdec8e 6b48a2c 6fdec8e f62b6c1 6fdec8e f62b6c1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
import base64
import streamlit as st
from config import *
from model import model_page
from contributors import contributors_page
st.set_page_config(
page_title=f"Omdena | Toronto Chapter",
page_icon="🍁",
initial_sidebar_state="expanded"
)
def set_page_background(png_file):
@st.cache_data()
def get_base64_of_bin_file(bin_file):
with open(bin_file, 'rb') as f:
data = f.read()
return base64.b64encode(data).decode()
bin_str = get_base64_of_bin_file(png_file)
custom_css = f'''
<style>
.stApp {{
background-image: url("data:image/png;base64,{bin_str}");
background-size: cover;
background-repeat: no-repeat;
background-attachment: scroll;
}}
#MainMenu {{visibility: hidden;}}
footer {{visibility: hidden;}}
icon {{color: white;}}
nav-link {{--hover-color: grey; }}
nav-link-selected {{background-color: #4ABF7E;}}
</style>
'''
st.markdown(custom_css, unsafe_allow_html=True)
set_page_background('assets/background.webp')
st.markdown(f"<style>{CSS}</style>", unsafe_allow_html=True)
def home_page():
st.write("# Early Detection and Diagnosis of Alzheimer's Disease through Brain Scan Analysis", unsafe_allow_html=True)
st.image(IMG_BANNER)
st.write(PROJECT_PROBLEM, unsafe_allow_html=True)
st.write(PROJECT_BACKGROUND, unsafe_allow_html=True)
left, right = st.columns(2)
with left:
st.write(PROJECT_GOALS, unsafe_allow_html=True)
with right:
st.write(PROJECT_TIMELINE, unsafe_allow_html=True)
def main():
st.sidebar.image("assets/logo.png")
st.sidebar.write(SIDEBAR_TEXT_1, unsafe_allow_html=True)
selected_task = st.sidebar.selectbox("Please navigate through the different sections of our website from here", ["Home", "About", "Model", "Contributors"], label_visibility="hidden")
st.sidebar.write(SIDEBAR_TEXT_2, unsafe_allow_html=True)
if selected_task == "Home":
home_page()
elif selected_task == "About":
st.write(ABOUT_US, unsafe_allow_html=True)
elif selected_task == "Model":
model_page()
elif selected_task == "Contributors":
contributors_page()
if __name__ == "__main__":
main() |