File size: 1,236 Bytes
a6ffd08
 
 
 
 
 
 
 
08f8448
 
 
55285fe
 
a6ffd08
ff33856
a6ffd08
 
 
 
05bdc41
a6ffd08
35972d5
a6ffd08
 
 
 
 
35972d5
a6ffd08
05bdc41
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
29
30
31
32
33
34
35
36
37
38
39
#IMPORTANT PART ONLY
#!pip install deepface
import gradio as gr

from deepface import DeepFace
#from google.colab import drive
#drive.mount('/content/drive')
#img1_path = '/content/drive/My Drive/Colab Notebooks/DeepLearning/FaceRecognition/PhotoDataSet/10Jan_1.jpeg'
#import zipfile
#with zipfile.ZipFile("PhotoDataSet.zip","r") as zip_ref:
    #zip_ref.extractall("db_path")



db_path='https://github.com/ipvikas/MyPhotos'

import pandas as pd
def get_deepface(image):

    df = DeepFace.find(img_path=image, db_path='https://github.com/ipvikas/MyPhotos')
    #print(df.head())
    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()