Roman
commited on
chore: improve app page structure
Browse files
app.py
CHANGED
|
@@ -382,9 +382,9 @@ with demo:
|
|
| 382 |
)
|
| 383 |
|
| 384 |
gr.Markdown("### Step 3. Generate the private key.")
|
| 385 |
-
|
| 386 |
-
keygen_button = gr.Button("Generate the private key.")
|
| 387 |
|
|
|
|
| 388 |
keygen_checkbox = gr.Checkbox(label="Private key generated:", interactive=False)
|
| 389 |
|
| 390 |
private_key_size = gr.Number(
|
|
@@ -394,9 +394,9 @@ with demo:
|
|
| 394 |
user_id = gr.Textbox(label="", max_lines=2, interactive=False, visible=False)
|
| 395 |
|
| 396 |
gr.Markdown("### Step 4. Encrypt the image using FHE.")
|
| 397 |
-
|
| 398 |
-
encrypt_button = gr.Button("Encrypt the image using FHE.")
|
| 399 |
|
|
|
|
| 400 |
# FIXME: Display an image representation here
|
| 401 |
# Currently not really possible as Concrete-Numpy does not give the ability to decrypt
|
| 402 |
# an encrypted input
|
|
@@ -418,18 +418,14 @@ with demo:
|
|
| 418 |
)
|
| 419 |
|
| 420 |
gr.Markdown("### Step 5. Send the encrypted image to the server.")
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
send_input_checkbox = gr.Checkbox(label="Encrypted image sent.", interactive=False)
|
| 425 |
|
| 426 |
gr.Markdown("### Step 6. Run FHE execution.")
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
label="Total FHE execution time (in seconds):", max_lines=1, interactive=False
|
| 432 |
-
)
|
| 433 |
|
| 434 |
gr.Markdown("### Step 7. Receive the encrypted output image from the server.")
|
| 435 |
gr.Markdown(
|
|
@@ -437,9 +433,9 @@ with demo:
|
|
| 437 |
"decrypted using a different private key. This is only used to visually represent an "
|
| 438 |
"encrypted image."
|
| 439 |
)
|
| 440 |
-
|
| 441 |
-
get_output_button = gr.Button("Receive the encrypted output image from the server.")
|
| 442 |
|
|
|
|
| 443 |
encrypted_output_representation = gr.Image(
|
| 444 |
label=f"Encrypted output representation ({INPUT_SHAPE[0]}x{INPUT_SHAPE[1]}):", interactive=False
|
| 445 |
)
|
|
|
|
| 382 |
)
|
| 383 |
|
| 384 |
gr.Markdown("### Step 3. Generate the private key.")
|
| 385 |
+
keygen_button = gr.Button("Generate the private key.")
|
|
|
|
| 386 |
|
| 387 |
+
with gr.Row():
|
| 388 |
keygen_checkbox = gr.Checkbox(label="Private key generated:", interactive=False)
|
| 389 |
|
| 390 |
private_key_size = gr.Number(
|
|
|
|
| 394 |
user_id = gr.Textbox(label="", max_lines=2, interactive=False, visible=False)
|
| 395 |
|
| 396 |
gr.Markdown("### Step 4. Encrypt the image using FHE.")
|
| 397 |
+
encrypt_button = gr.Button("Encrypt the image using FHE.")
|
|
|
|
| 398 |
|
| 399 |
+
with gr.Row():
|
| 400 |
# FIXME: Display an image representation here
|
| 401 |
# Currently not really possible as Concrete-Numpy does not give the ability to decrypt
|
| 402 |
# an encrypted input
|
|
|
|
| 418 |
)
|
| 419 |
|
| 420 |
gr.Markdown("### Step 5. Send the encrypted image to the server.")
|
| 421 |
+
send_input_button = gr.Button("Send the encrypted image to the server.")
|
| 422 |
+
send_input_checkbox = gr.Checkbox(label="Encrypted image sent.", interactive=False)
|
|
|
|
|
|
|
| 423 |
|
| 424 |
gr.Markdown("### Step 6. Run FHE execution.")
|
| 425 |
+
execute_fhe_button = gr.Button("Run FHE execution.")
|
| 426 |
+
fhe_execution_time = gr.Textbox(
|
| 427 |
+
label="Total FHE execution time (in seconds):", max_lines=1, interactive=False
|
| 428 |
+
)
|
|
|
|
|
|
|
| 429 |
|
| 430 |
gr.Markdown("### Step 7. Receive the encrypted output image from the server.")
|
| 431 |
gr.Markdown(
|
|
|
|
| 433 |
"decrypted using a different private key. This is only used to visually represent an "
|
| 434 |
"encrypted image."
|
| 435 |
)
|
| 436 |
+
get_output_button = gr.Button("Receive the encrypted output image from the server.")
|
|
|
|
| 437 |
|
| 438 |
+
with gr.Row():
|
| 439 |
encrypted_output_representation = gr.Image(
|
| 440 |
label=f"Encrypted output representation ({INPUT_SHAPE[0]}x{INPUT_SHAPE[1]}):", interactive=False
|
| 441 |
)
|