#ALL as a whole import os import gradio as gr from deepface import DeepFace import matplotlib.pyplot as plt def get_deepface_verify(img1_path, img2_path, model_name): #img1_detect= DeepFace.detectFace(img1_path) #img2_detect= DeepFace.detectFace(img2_path) model_name = 'ArcFace' #VGG-Face, Facenet, OpenFace, DeepFace, DeepID, Dlib, ArcFace or Ensemble result = DeepFace.verify(img1_path=img1_path,img2_path=img2_path,model_name = model_name) return result title = "DeepFace" description = "Deepface is a lightweight face recognition and facial attribute analysis (age, gender, emotion and race) framework for python. It is a hybrid face recognition framework wrapping state-of-the-art models: VGG-Face, Google FaceNet, OpenFace, Facebook DeepFace, DeepID, ArcFace and Dlib." examples=[["10Jan_1.jpeg"],["10Jan_2.jpeg"]] facial_attribute_demo = gr.Interface(get_deepface_verify,["image","image"], [gr.outputs.Label(label="same person"),gr.outputs.Label(label="distance"),gr.outputs.Label(label="max threshold to verify"),gr.outputs.Label(label="model"),gr.outputs.Label(label="similarity metric")],enable_queue=True,examples=examples,title=title,description=description,theme="dark default") facial_attribute_demo.launch(debug=True)