Spaces:
Sleeping
Sleeping
File size: 719 Bytes
48681cf 821315b 48681cf ef5548b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from deepface import DeepFace
# Face comparison function
def verify_faces(image1, image2):
result = DeepFace.verify(image1, image2)
if result["verified"]:
return "β
Faces Match!", f"π Distance Score: {result['distance']:.4f}"
else:
return "β Faces Do Not Match!", f"π Distance Score: {result['distance']:.4f}"
# Gradio Interface
iface = gr.Interface(
fn=verify_faces,
inputs=[gr.Image(type="filepath"), gr.Image(type="filepath")], # Two image inputs
outputs=["text", "text"],
title="π Face Authentication System",
description="Upload two images to check if they belong to the same person."
)
# Launch Gradio
iface.launch(share=True)
|