File size: 452 Bytes
da905ba
09365fc
da905ba
09365fc
da905ba
09365fc
 
 
 
9dbc6ca
da905ba
09365fc
1
2
3
4
5
6
7
8
9
10
11
12
from deepface import DeepFace
import gradio as gr

def face_analysis(img):
  face_analysis = DeepFace.analyze(img_path = img)
  emotion = face_analysis[0]["dominant_emotion"]
  gender = face_analysis[0]["dominant_gender"]
  age = face_analysis[0]["age"]
  race = face_analysis[0]["dominant_race"]
  return("This is a " + str(gender) + ", " + str(age) + " years old and is " + str(emotion))

gr.Interface(face_analysis,"image","text").launch(share=True)