Update app.py
Browse files
app.py
CHANGED
|
@@ -238,9 +238,28 @@ def delete_person_ui():
|
|
| 238 |
result = delete_person(name)
|
| 239 |
st.success(result)
|
| 240 |
|
|
|
|
| 241 |
def tour_guide_ui():
|
| 242 |
st.title("Tour Guide")
|
| 243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
# Streamlit interface for user authentication
|
| 246 |
def authenticate_user_ui():
|
|
@@ -296,32 +315,26 @@ def logout():
|
|
| 296 |
# Define tour steps
|
| 297 |
steps = [
|
| 298 |
{
|
| 299 |
-
"element": "h1",
|
| 300 |
"title": "Welcome to Insta's EYE",
|
| 301 |
"content": "This is a tour guide to help you navigate through the application.",
|
| 302 |
},
|
| 303 |
{
|
| 304 |
-
"element": '[aria-label="Select Option"]',
|
| 305 |
"title": "Options Sidebar",
|
| 306 |
"content": "Here you can select different options such as adding a person, recognizing a face, deleting a person, or recognizing a face with optimal identification.",
|
| 307 |
},
|
| 308 |
{
|
| 309 |
-
"element": "div[class='element-container']",
|
| 310 |
"title": "Main Interface",
|
| 311 |
"content": "This is where the main functionality of the application is displayed.",
|
| 312 |
},
|
| 313 |
{
|
| 314 |
-
"element": "[data-testid='stFileUploader']",
|
| 315 |
"title": "Upload Image",
|
| 316 |
"content": "You can upload an image here for face recognition or adding a person.",
|
| 317 |
},
|
| 318 |
{
|
| 319 |
-
"element": "[data-testid='stTextInput']",
|
| 320 |
"title": "Text Input",
|
| 321 |
"content": "Enter text here such as the person's name or Instagram handle.",
|
| 322 |
},
|
| 323 |
{
|
| 324 |
-
"element": "[data-testid='stButton']",
|
| 325 |
"title": "Buttons",
|
| 326 |
"content": "Click on these buttons to perform actions like adding a person or recognizing a face.",
|
| 327 |
},
|
|
@@ -341,11 +354,9 @@ def display_tour_steps(steps):
|
|
| 341 |
# Update the main function to include the new option
|
| 342 |
def main():
|
| 343 |
st.sidebar.title("Options")
|
| 344 |
-
option = st.sidebar.radio("Select Option", ["
|
| 345 |
|
| 346 |
-
if option == "
|
| 347 |
-
tour_guide_ui()
|
| 348 |
-
elif option == "Add Person":
|
| 349 |
add_person_ui()
|
| 350 |
elif option == "Recognize Face":
|
| 351 |
recognize_face_ui()
|
|
@@ -353,6 +364,8 @@ def main():
|
|
| 353 |
delete_person_ui()
|
| 354 |
elif option == "Recognize Face (Optimal)":
|
| 355 |
recognize_face_optimal_ui()
|
|
|
|
|
|
|
| 356 |
|
| 357 |
# Run the tour guide
|
| 358 |
if __name__ == "__main__":
|
|
|
|
| 238 |
result = delete_person(name)
|
| 239 |
st.success(result)
|
| 240 |
|
| 241 |
+
# Function to display tour steps
|
| 242 |
def tour_guide_ui():
|
| 243 |
st.title("Tour Guide")
|
| 244 |
+
st.markdown("This tour will guide you through the application.")
|
| 245 |
+
|
| 246 |
+
with st.beta_expander("Welcome"):
|
| 247 |
+
st.write("This is a tour guide to help you navigate through the application.")
|
| 248 |
+
|
| 249 |
+
with st.beta_expander("Options Sidebar"):
|
| 250 |
+
st.write("Here you can select different options such as adding a person, recognizing a face, deleting a person, or recognizing a face with optimal identification.")
|
| 251 |
+
|
| 252 |
+
with st.beta_expander("Main Interface"):
|
| 253 |
+
st.write("This is where the main functionality of the application is displayed.")
|
| 254 |
+
|
| 255 |
+
with st.beta_expander("Upload Image"):
|
| 256 |
+
st.write("You can upload an image here for face recognition or adding a person.")
|
| 257 |
+
|
| 258 |
+
with st.beta_expander("Text Input"):
|
| 259 |
+
st.write("Enter text here such as the person's name or Instagram handle.")
|
| 260 |
+
|
| 261 |
+
with st.beta_expander("Buttons"):
|
| 262 |
+
st.write("Click on these buttons to perform actions like adding a person or recognizing a face.")
|
| 263 |
|
| 264 |
# Streamlit interface for user authentication
|
| 265 |
def authenticate_user_ui():
|
|
|
|
| 315 |
# Define tour steps
|
| 316 |
steps = [
|
| 317 |
{
|
|
|
|
| 318 |
"title": "Welcome to Insta's EYE",
|
| 319 |
"content": "This is a tour guide to help you navigate through the application.",
|
| 320 |
},
|
| 321 |
{
|
|
|
|
| 322 |
"title": "Options Sidebar",
|
| 323 |
"content": "Here you can select different options such as adding a person, recognizing a face, deleting a person, or recognizing a face with optimal identification.",
|
| 324 |
},
|
| 325 |
{
|
|
|
|
| 326 |
"title": "Main Interface",
|
| 327 |
"content": "This is where the main functionality of the application is displayed.",
|
| 328 |
},
|
| 329 |
{
|
|
|
|
| 330 |
"title": "Upload Image",
|
| 331 |
"content": "You can upload an image here for face recognition or adding a person.",
|
| 332 |
},
|
| 333 |
{
|
|
|
|
| 334 |
"title": "Text Input",
|
| 335 |
"content": "Enter text here such as the person's name or Instagram handle.",
|
| 336 |
},
|
| 337 |
{
|
|
|
|
| 338 |
"title": "Buttons",
|
| 339 |
"content": "Click on these buttons to perform actions like adding a person or recognizing a face.",
|
| 340 |
},
|
|
|
|
| 354 |
# Update the main function to include the new option
|
| 355 |
def main():
|
| 356 |
st.sidebar.title("Options")
|
| 357 |
+
option = st.sidebar.radio("Select Option", ["Add Person", "Recognize Face", "Delete Person", "Recognize Face (Optimal)","Tour Guide"])
|
| 358 |
|
| 359 |
+
if option == "Add Person":
|
|
|
|
|
|
|
| 360 |
add_person_ui()
|
| 361 |
elif option == "Recognize Face":
|
| 362 |
recognize_face_ui()
|
|
|
|
| 364 |
delete_person_ui()
|
| 365 |
elif option == "Recognize Face (Optimal)":
|
| 366 |
recognize_face_optimal_ui()
|
| 367 |
+
elif option == "Tour Guide":
|
| 368 |
+
tour_guide_ui()
|
| 369 |
|
| 370 |
# Run the tour guide
|
| 371 |
if __name__ == "__main__":
|