generated from OttomanZ/Best-README-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOMEPAGE.py
64 lines (52 loc) Β· 2.53 KB
/
HOMEPAGE.py
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
import pandas as pd
import os
import numpy as np
import random
import openai
import yaml
import streamlit as st
from yaml.loader import SafeLoader
import streamlit_authenticator as stauth
from streamlit_authenticator.utilities import (CredentialsError,
ForgotError,
Hasher,
LoginError,
RegisterError,
ResetError,
UpdateError)
# Loading config file
with open('/home/docwynai/Arzachel/config.yaml', 'r', encoding='utf-8') as file:
config = yaml.load(file, Loader=SafeLoader)
# Pre-hashing all plain text passwords once
# stauth.Hasher.hash_passwords(config['credentials'])
# Creating the authenticator object
authenticator = stauth.Authenticate(
config['credentials'],
config['cookie']['name'],
config['cookie']['key'],
config['cookie']['expiry_days']
)
# Image URL
image_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Azarquiel_%28MUNCYT%2C_Eulogia_Merle%29.jpg/330px-Azarquiel_%28MUNCYT%2C_Eulogia_Merle%29.jpg"
# Markdown to center the image with proper size and rounding, emojis, Azrachel mention, and the welcome message in small text
markdown_content = f"""
<div style='text-align: center;'>
<img src='{image_url}' style='border-radius: 50%; width: 200px; height: 200px;' />
<p><strong>Azrachel</strong></p>
<small>Welcome to <strong>Arzachel</strong> at your service! πβ¨ Optimized for Agriculture πΎπ±, this project leverages cutting-edge vision-language models to derive actionable insights from space imagery. Whether itβs crop monitoring, land usage, or environmental changes, Arzachel empowers users to make informed decisions from NASA ππ.</small>
</div>
"""
with st.sidebar:
with st.expander('Developer Tools π§'):
st.json(st.session_state)
# Display the content using unsafe HTML
st.markdown(markdown_content, unsafe_allow_html=True)
st.divider()
if not st.session_state['authentication_status']:
if st.button('Login Page', icon='π', use_container_width=True):
st.switch_page('pages/π_LOGIN.py')
if st.session_state['authentication_status']:
if st.button('Select Farmland Area', icon='πΎ', use_container_width=True):
st.switch_page('pages/πΎ_MY_FARM.py')
if st.button('Logout', icon='πͺ', use_container_width=True):
st.switch_page('pages/πͺ_LOGOUT.py')