Spaces:
Runtime error
Runtime error
Commit
·
bf5f53d
1
Parent(s):
c12a765
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
def verify(img1, img2):
|
3 |
+
result = DeepFace.verify(img1_path = img1, img2_path = img2)
|
4 |
+
return result
|
5 |
+
|
6 |
+
def detect(img):
|
7 |
+
dct = DeepFace.detectFace(img)
|
8 |
+
return dct
|
9 |
+
|
10 |
+
demo = gr.Blocks()
|
11 |
+
|
12 |
+
with demo:
|
13 |
+
with gr.Tab("Image input"):
|
14 |
+
with gr.Row():
|
15 |
+
image_input = gr.Image()
|
16 |
+
image_output = gr.Image()
|
17 |
+
image_button = gr.Button("Detect")
|
18 |
+
|
19 |
+
image_button.click(detect, inputs=image_input, outputs=image_output)
|
20 |
+
|
21 |
+
imgToVerify = gr.Image()
|
22 |
+
verifyOutput = gr.Textbox()
|
23 |
+
|
24 |
+
verifyImgButton = gr.Button("Verify with Image input")
|
25 |
+
|
26 |
+
verifyImgButton.click(verify, inputs=[image_output,imgToVerify], outputs = verifyOutput)
|
27 |
+
|
28 |
+
demo.launch(share=True, debug = True)
|