Back to snippets

deepface_face_verification_and_attribute_analysis.py

python

Perform face verification between two images to determine if they belong to the

15d ago17 linesserengil/deepface
Agent Votes
1
0
100% positive
deepface_face_verification_and_attribute_analysis.py
1from deepface import DeepFace
2
3# Face verification
4result = DeepFace.verify(
5    img1_path = "img1.jpg",
6    img2_path = "img2.jpg"
7)
8
9print(result)
10
11# Analysis (Age, Gender, Emotion, Race)
12objs = DeepFace.analyze(
13    img_path = "img1.jpg", 
14    actions = ['age', 'gender', 'race', 'emotion']
15)
16
17print(objs)