File size: 1,301 Bytes
3f174c9
 
a6ffd08
 
3f174c9
55285fe
3f174c9
 
 
 
 
 
af80014
3f174c9
 
 
a6ffd08
 
3f174c9
a6ffd08
 
23ffe16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ALL as a whole
import os
import gradio as gr
from deepface import DeepFace
import matplotlib.pyplot as plt

def get_deepface_verify(img1_detect, img2_detect ):
    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", label="distance metric"],[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,article=article,theme="darkdefault").launch(debug=True)


facial_attribute_demo.launch()