File size: 1,056 Bytes
a6ffd08
 
55285fe
1b11b43
55285fe
1b11b43
 
a6ffd08
 
 
 
bd32536
35972d5
a6ffd08
 
 
 
35972d5
a6ffd08
9b0e6f7
0c23e21
a6ffd08
 
 
 
 
05bdc41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from deepface import DeepFace

db_path='https://huggingface.co/spaces/ipvikas/ImageProcessing/blob/main/MyPhotos'

#from datasets import load_dataset
#db_path= load_dataset("imagefolder", data_files="https://huggingface.co/spaces/ipvikas/ImageProcessing/blob/main/PhotoDataSet.zip")


import pandas as pd
def get_deepface(image):
    df = DeepFace.find(img_path=image, db_path=db_path)
    return DeepFace.analyze(img_path=image)

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."

facial_attribute_demo = gr.Interface(
    fn=get_deepface,
    inputs="image",
    outputs=['text'],
    title="face recognition and facial attribute analysis",
    description=description,
    enable_queue=True,
    examples=[["10Jan_1.jpeg"]],
    cache_examples=False)

facial_attribute_demo.launch()