File size: 1,259 Bytes
3f174c9
 
a6ffd08
 
3f174c9
55285fe
9dcd5e5
 
 
3f174c9
 
 
af80014
3f174c9
 
 
a6ffd08
31e56a1
a6ffd08
e9e229b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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)