Ashoka74 commited on
Commit
63feda0
ยท
verified ยท
1 Parent(s): 4a5e189

Update app.py

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