Thomas Chardonnens
commited on
Commit
·
b831724
1
Parent(s):
f397840
just return the encrypted image string
Browse files
app.py
CHANGED
@@ -176,10 +176,11 @@ def encrypt(user_id, input_image):
|
|
176 |
with encrypted_image_path.open("wb") as encrypted_image_file:
|
177 |
encrypted_image_file.write(encrypted_image)
|
178 |
|
179 |
-
#
|
180 |
-
encrypted_image_short =
|
|
|
|
|
181 |
|
182 |
-
return (resize_img(input_image), encrypted_image_short)
|
183 |
|
184 |
def send_input(user_id):
|
185 |
"""Send the encrypted input image as well as the evaluation key to the server.
|
@@ -410,7 +411,7 @@ with demo:
|
|
410 |
encrypt_button.click(
|
411 |
encrypt,
|
412 |
inputs=[user_id, input_image],
|
413 |
-
outputs=[
|
414 |
)
|
415 |
|
416 |
# Button to send the encodings to the server using post method
|
|
|
176 |
with encrypted_image_path.open("wb") as encrypted_image_file:
|
177 |
encrypted_image_file.write(encrypted_image)
|
178 |
|
179 |
+
# Get a short representation of the encrypted image for display purposes
|
180 |
+
encrypted_image_short = encrypted_image[:100] # Take first 100 bytes
|
181 |
+
|
182 |
+
return encrypted_image_short
|
183 |
|
|
|
184 |
|
185 |
def send_input(user_id):
|
186 |
"""Send the encrypted input image as well as the evaluation key to the server.
|
|
|
411 |
encrypt_button.click(
|
412 |
encrypt,
|
413 |
inputs=[user_id, input_image],
|
414 |
+
outputs=[encrypted_input],
|
415 |
)
|
416 |
|
417 |
# Button to send the encodings to the server using post method
|