Ashoka74 commited on
Commit
a9890e3
ยท
verified ยท
1 Parent(s): 6e691b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -44
app.py CHANGED
@@ -29,8 +29,6 @@ def add_auth(
29
  login_button_color=login_button_color,
30
  )
31
 
32
-
33
-
34
  def require_auth(
35
  login_button_text: str = "Login with Google",
36
  login_button_color: str = "#FD504D",
@@ -116,45 +114,46 @@ st.set_page_config(
116
  add_auth(required=True, login_button_color="#FFA500",subscribe_color_button="#FFA500")
117
 
118
  if st.session_state.email is not '':
119
- st.write(f'User: {st.session_state.email}')
120
-
121
-
122
- if "buttons" in st.session_state:
123
- st.session_state.buttons = st.session_state.buttons
124
-
125
-
126
-
127
- from PIL import Image
128
- import base64
129
-
130
- def get_base64_of_bin_file(bin_file):
131
- with open(bin_file, 'rb') as f:
132
- data = f.read()
133
- return base64.b64encode(data).decode()
134
-
135
- def set_png_as_page_bg(png_file):
136
- bin_str = get_base64_of_bin_file(png_file)
137
- page_bg_img = '''
138
- <style>
139
- .stApp {
140
- background-image: url("data:image/png;base64,%s");
141
- background-size: cover;
142
- }
143
- </style>
144
- ''' % bin_str
145
- st.markdown(page_bg_img, unsafe_allow_html=True)
146
-
147
-
148
- if st.toggle('Set background image', True):
149
- set_png_as_page_bg('saucer.webp') # Replace with your background image path
150
-
151
-
152
- pg = st.navigation([
153
- st.Page("rag_search.py", title="Smart-Search (Retrieval Augmented Generations)", icon="๐Ÿ”"),
154
- st.Page("parsing.py", title="UAP Feature Extraction (Shape, Speed, Color)", icon="๐Ÿ“„"),
155
- st.Page("analyzing.py", title="Statistical Analysis (UMAP+HDBSCAN, XGBoost, V-Cramer)", icon="๐Ÿง "),
156
- st.Page("magnetic.py", title="Magnetic Anomaly Detection (InterMagnet Stations)", icon="๐Ÿงฒ"),
157
- st.Page("map.py", title="Interactive Map (Tracking variations, Proximity with Military Bases, Nuclear Facilities)", icon="๐Ÿ—บ๏ธ"),
158
- ])
159
-
160
- pg.run()
 
 
29
  login_button_color=login_button_color,
30
  )
31
 
 
 
32
  def require_auth(
33
  login_button_text: str = "Login with Google",
34
  login_button_color: str = "#FD504D",
 
114
  add_auth(required=True, login_button_color="#FFA500",subscribe_color_button="#FFA500")
115
 
116
  if st.session_state.email is not '':
117
+ st.write('')
118
+ st.write(f'User: {st.session_state.email}')
119
+
120
+ if "buttons" in st.session_state:
121
+ st.session_state.buttons = st.session_state.buttons
122
+
123
+ from PIL import Image
124
+ import base64
125
+
126
+ def get_base64_of_bin_file(bin_file):
127
+ with open(bin_file, 'rb') as f:
128
+ data = f.read()
129
+ return base64.b64encode(data).decode()
130
+
131
+ def set_png_as_page_bg(png_file):
132
+ bin_str = get_base64_of_bin_file(png_file)
133
+ page_bg_img = '''
134
+ <style>
135
+ .stApp {
136
+ background-image: url("data:image/png;base64,%s");
137
+ background-size: cover;
138
+ }
139
+ </style>
140
+ ''' % bin_str
141
+ st.markdown(page_bg_img, unsafe_allow_html=True)
142
+
143
+
144
+ if st.toggle('Set background image', True):
145
+ set_png_as_page_bg('saucer.webp') # Replace with your background image path
146
+
147
+ if st.session_state.user_subscribed:
148
+ pg = st.navigation([
149
+ st.Page("rag_search.py", title="Smart-Search (Retrieval Augmented Generations)", icon="๐Ÿ”"),
150
+ st.Page("parsing.py", title="UAP Feature Extraction (Shape, Speed, Color)", icon="๐Ÿ“„"),
151
+ st.Page("analyzing.py", title="Statistical Analysis (UMAP+HDBSCAN, XGBoost, V-Cramer)", icon="๐Ÿง "),
152
+ st.Page("magnetic.py", title="Magnetic Anomaly Detection (InterMagnet Stations)", icon="๐Ÿงฒ"),
153
+ st.Page("map.py", title="Interactive Map (Tracking variations, Proximity with Military Bases, Nuclear Facilities)", icon="๐Ÿ—บ๏ธ"),
154
+ ])
155
+ pg.run()
156
+ else:
157
+ st.write('Please subscribe to access tools')
158
+ else:
159
+ st.write('Please login to your account')