usmanabbasi/Ekyc_Using_Computer_Vision
1
1import streamlit as st
2from PIL import Image
3from compare_faces import compare_faces
4import tempfile
5
6def face_comparison_page():
7 st.title("ID Card and Face Verification")
8
9 id_card_image = st.file_uploader("Upload your ID card image", type=["jpg", "jpeg", "png"])
10 face_image = st.file_uploader("Upload your face image", type=["jpg", "jpeg", "png"])
11
12 if id_card_image and face_image:
13 with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as id_temp:
14 id_temp.write(id_card_image.read())
15 id_temp_path = id_temp.name
16
17 with tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") as face_temp:
18 face_temp.write(face_image.read())
19 face_temp_path = face_temp.name
20
21 result = compare_faces(id_temp_path, face_temp_path)
22 st.write(result)
23 