Spaces:
Runtime error
Runtime error
pip3 install deepface | |
import gradio as gr | |
from deepface import DeepFace | |
def verify(img1, img2): | |
result = DeepFace.verify(img1_path = img1, img2_path = img2) | |
return result | |
def detect(img): | |
dct = DeepFace.detectFace(img) | |
return dct | |
demo = gr.Blocks() | |
with demo: | |
with gr.Tab("Image input"): | |
with gr.Row(): | |
image_input = gr.Image() | |
image_output = gr.Image() | |
image_button = gr.Button("Detect") | |
image_button.click(detect, inputs=image_input, outputs=image_output) | |
imgToVerify = gr.Image() | |
verifyOutput = gr.Textbox() | |
verifyImgButton = gr.Button("Verify with Image input") | |
verifyImgButton.click(verify, inputs=[image_output,imgToVerify], outputs = verifyOutput) | |
demo.launch(share=True, debug = True) |