Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,22 +55,20 @@ def recognize_user(image):
|
|
| 55 |
except Exception as e:
|
| 56 |
return f"Error during recognition: {str(e)}"
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
)
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
)
|
| 73 |
|
| 74 |
-
|
| 75 |
-
register_interface.launch(share=True)
|
| 76 |
-
recognize_interface.launch(share=True)
|
|
|
|
| 55 |
except Exception as e:
|
| 56 |
return f"Error during recognition: {str(e)}"
|
| 57 |
|
| 58 |
+
with gr.Blocks() as demo:
|
| 59 |
+
with gr.Tab("Register"):
|
| 60 |
+
with gr.Row():
|
| 61 |
+
img = gr.Image()
|
| 62 |
+
user_id = gr.Textbox(label="User ID")
|
| 63 |
+
register_button = gr.Button("Register")
|
| 64 |
+
register_output = gr.Textbox()
|
| 65 |
+
register_button.click(register_user, inputs=[img, user_id], outputs=register_output)
|
| 66 |
|
| 67 |
+
with gr.Tab("Recognize"):
|
| 68 |
+
with gr.Row():
|
| 69 |
+
img = gr.Image()
|
| 70 |
+
recognize_button = gr.Button("Recognize")
|
| 71 |
+
recognize_output = gr.Textbox()
|
| 72 |
+
recognize_button.click(recognize_user, inputs=img, outputs=recognize_output)
|
|
|
|
| 73 |
|
| 74 |
+
demo.launch(share=True)
|
|
|
|
|
|