team14: verio - working version 2
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 📸 🌄
|
4 |
colorFrom: purple
|
5 |
colorTo: purple
|
|
|
1 |
---
|
2 |
+
title: Team14 Verio “Privacy-Preserving Biometric Verification for Authentication”
|
3 |
emoji: 📸 🌄
|
4 |
colorFrom: purple
|
5 |
colorTo: purple
|
app.py
CHANGED
@@ -43,34 +43,34 @@ subprocess.Popen(["uvicorn", "server:app"], cwd=REPO_DIR)
|
|
43 |
time.sleep(3)
|
44 |
|
45 |
|
46 |
-
def decrypt_output_with_wrong_key(encrypted_image):
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
|
73 |
-
|
74 |
|
75 |
|
76 |
def shorten_bytes_object(bytes_object, limit=500):
|
@@ -667,7 +667,12 @@ with demo:
|
|
667 |
)
|
668 |
|
669 |
with gr.Row():
|
670 |
-
encrypted_output_representation = gr.Label()
|
|
|
|
|
|
|
|
|
|
|
671 |
# encrypted_output_representation = gr.Image(
|
672 |
# label=f"Encrypted output representation ({INPUT_SHAPE[0]}x{INPUT_SHAPE[1]}):",
|
673 |
# interactive=False,
|
|
|
43 |
time.sleep(3)
|
44 |
|
45 |
|
46 |
+
# def decrypt_output_with_wrong_key(encrypted_image):
|
47 |
+
# """Decrypt the encrypted output using a different private key."""
|
48 |
+
# # Retrieve the matcher's deployment path
|
49 |
+
# matcher_path = MATCHERS_PATH / f"{matcher_name}/deployment"
|
50 |
|
51 |
+
# # Instantiate the client interface and generate a new private key
|
52 |
+
# wrong_client = FHEClient(matcher_path, matcher_name)
|
53 |
+
# wrong_client.generate_private_and_evaluation_keys(force=True)
|
54 |
|
55 |
+
# # Deserialize, decrypt and post-process the encrypted output using the new private key
|
56 |
+
# output_result = wrong_client.deserialize_decrypt_post_process(encrypted_image)
|
57 |
|
58 |
+
# # # For matchers that are expected to output black and white images, generate two other random
|
59 |
+
# # # channels for better display
|
60 |
+
# # if matcher_name in ["black and white", "ridge detection"]:
|
61 |
+
# # # Green channel
|
62 |
+
# # wrong_client.generate_private_and_evaluation_keys(force=True)
|
63 |
+
# # output_result[:, :, 1] = wrong_client.deserialize_decrypt_post_process(
|
64 |
+
# # encrypted_image
|
65 |
+
# # )[:, :, 0]
|
66 |
|
67 |
+
# # # Blue channel
|
68 |
+
# # wrong_client.generate_private_and_evaluation_keys(force=True)
|
69 |
+
# # output_result[:, :, 2] = wrong_client.deserialize_decrypt_post_process(
|
70 |
+
# # encrypted_image
|
71 |
+
# # )[:, :, 0]
|
72 |
|
73 |
+
# return output_result
|
74 |
|
75 |
|
76 |
def shorten_bytes_object(bytes_object, limit=500):
|
|
|
667 |
)
|
668 |
|
669 |
with gr.Row():
|
670 |
+
# encrypted_output_representation = gr.Label()
|
671 |
+
encrypted_output_representation = gr.Textbox(
|
672 |
+
label="Encrypted encrypted output result:",
|
673 |
+
max_lines=2,
|
674 |
+
interactive=False,
|
675 |
+
)
|
676 |
# encrypted_output_representation = gr.Image(
|
677 |
# label=f"Encrypted output representation ({INPUT_SHAPE[0]}x{INPUT_SHAPE[1]}):",
|
678 |
# interactive=False,
|