Kichkun / deepface

Age and Race prediction by a single face image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Age and Race predictor from single selfie

Installation

git clone #https://github.com/Kichkun/deepface.git
cd deepface
pip install .

Age and Race recognition including asian, white, middle eastern, indian, latino and black predictions.

from deepface import DeepFace
demography = DeepFace.analyze("img4.jpg", actions = ['age', 'race'])
#demographies = DeepFace.analyze(["img1.jpg", "img2.jpg", "img3.jpg"]) #analyzing multiple faces same time
print("Age: ", demography["age"])
print("Race: ", demography["dominant_race"])

{'age': 50.75593731981769,
 'dominant_race': 'white',
 'race': {'asian': 1.3692333378223509e-08,
  'black': 1.682867603949867e-10,
  'indian': 1.8962782455389515e-07,
  'latino hispanic': 0.0014391415788850281,
  'middle eastern': 0.01635842927498743,
  'white': 99.98220801353455}}

About

Age and Race prediction by a single face image

License:MIT License


Languages

Language:Python 100.0%