import streamlit as st
from PIL import Image
import base64
from io import BytesIO
def image_to_base64(img):
buffered = BytesIO()
img.save(buffered, format="PNG")
return base64.b64encode(buffered.getvalue()).decode()
def display_homepage():
image = Image.open('image.jpg')
img_base64 = image_to_base64(image)
st.markdown(
f"""
AI Support for Your Mental Well-Being
Designed to streamline your mental health journey, our AI therapist is here to offer round-the-clock support, addressing mental health-related queries, providing personalized reports, and helping you understand your stress level to ensure a smoother journey toward mental and emotional health.
""", unsafe_allow_html=True
)
col1, col2 = st.columns([1, 1])
with col1:
if st.button("Start Chat", key="start_chat_button"):
st.session_state.page = "chat"
with col2:
if st.button("Stress Test", key="predict_stress_button"):
st.session_state.page = "stress"