Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,12 @@ import os
|
|
3 |
import gradio as gr
|
4 |
from deepface import DeepFace
|
5 |
import matplotlib.pyplot as plt
|
|
|
6 |
|
7 |
def get_deepface_verify(img1_path, img2_path, model_name):
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
result = DeepFace.verify(img1_path=img1_path,img2_path=img2_path,model_name = model_name)
|
12 |
return result
|
13 |
|
@@ -15,6 +16,6 @@ title = "DeepFace"
|
|
15 |
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."
|
16 |
examples=[["10Jan_1.jpeg"],["10Jan_2.jpeg"]]
|
17 |
|
18 |
-
facial_attribute_demo = gr.Interface(get_deepface_verify, ["
|
19 |
|
20 |
facial_attribute_demo.launch(debug=True)
|
|
|
3 |
import gradio as gr
|
4 |
from deepface import DeepFace
|
5 |
import matplotlib.pyplot as plt
|
6 |
+
model_name = 'ArcFace' #VGG-Face, Facenet, OpenFace, DeepFace, DeepID, Dlib, ArcFace or Ensemble
|
7 |
|
8 |
def get_deepface_verify(img1_path, img2_path, model_name):
|
9 |
+
img1_detect= DeepFace.detectFace(img1_path)
|
10 |
+
img2_detect= DeepFace.detectFace(img2_path)
|
11 |
+
|
12 |
result = DeepFace.verify(img1_path=img1_path,img2_path=img2_path,model_name = model_name)
|
13 |
return result
|
14 |
|
|
|
16 |
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."
|
17 |
examples=[["10Jan_1.jpeg"],["10Jan_2.jpeg"]]
|
18 |
|
19 |
+
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")],examples=examples, title=title,description=description,theme="darkdefault")
|
20 |
|
21 |
facial_attribute_demo.launch(debug=True)
|