|
|
|
import datetime |
|
import os |
|
import streamlit as st |
|
from PIL import Image |
|
from streamlit_extras.switch_page_button import switch_page |
|
from baam_functions import * |
|
from pathlib import Path |
|
|
|
|
|
sourceFileDir = Path( |
|
os.path.dirname(os.path.abspath(__file__))).parent.absolute() |
|
os.chdir(sourceFileDir) |
|
|
|
logo = Image.open('img/logo.png') |
|
st.set_page_config(page_title="BAAM", page_icon=logo) |
|
|
|
|
|
def main(): |
|
|
|
user_dict = st.session_state['user_dict'] |
|
|
|
|
|
username = user_dict.get('username', '') |
|
|
|
|
|
col1, col2, col3 = st.columns([6, 6, 2]) |
|
with col1: |
|
st.subheader("Welcome " + username) |
|
with col2: |
|
st.write(' ') |
|
with col3: |
|
st.image("img/Standard_Chartered.png", width=100) |
|
|
|
|
|
col1, col2 = st.columns(2) |
|
|
|
with col1: |
|
st.image("img/bank_sidebar.png") |
|
|
|
with col2: |
|
|
|
st.info('Please take a photo to verify your face') |
|
img_file_buffer = st.camera_input("Take a picture") |
|
if img_file_buffer: |
|
face_verification = verify_face(username, img_file_buffer) |
|
|
|
if face_verification: |
|
st.info("Congrats! You passed face verification") |
|
|
|
add_login_data(user_dict) |
|
|
|
st.session_state['verification'] = face_verification |
|
st.image("img/sent.png", width=400) |
|
else: |
|
st.info("Please make sure your face is clear.") |
|
st.image("img/TestFail.png", width=200) |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
main() |
|
|