File size: 1,096 Bytes
3f174c9
 
a6ffd08
 
3f174c9
48845d8
55285fe
9dcd5e5
48845d8
 
 
3f174c9
 
af80014
3f174c9
 
 
a6ffd08
8b87aed
 
a6ffd08
e9e229b
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
model_name = 'ArcFace'  #VGG-Face, Facenet, OpenFace, DeepFace, DeepID, Dlib, ArcFace or Ensemble

def get_deepface_verify(img1_path, img2_path, model_name):
    img1_detect= DeepFace.detectFace(img1_path)
    img2_detect= DeepFace.detectFace(img2_path)
    
    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, inputs = ["image","image"],outputs="json",title=title,
    description=description,enable_queue=True,examples=[["10Jan_1.jpeg"]],cache_examples=False)

facial_attribute_demo.launch(debug=True)