Spaces:
Sleeping
Sleeping
File size: 724 Bytes
adff838 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import streamlit as st
import image
from db import Database
def login():
picture = st.camera_input("picture",key = "registercam", label_visibility='hidden')
if picture:
unknown_user_dir = "./unknown_user/"
unknown_user_name = "unknown_user"
image.save_image(picture, unknown_user_dir, unknown_user_name)
is_match, user_id = image.compare_faces_in_directory("./known_user/", unknown_user_dir)
if is_match:
db = Database()
st.write(user_id)
user_detail = db.get_user_detail(user_id)
st.write(user_detail)
else:
st.error("No Match Found")
image.delete_image(unknown_user_dir + unknown_user_name)
|