DeepFace Python tutorial: face matching and analysis

Learn DeepFace face matching, image database search and facial analysis in Python, including a failed match with a generated older face.

Player not loading? Watch on YouTube

This Python tutorial introduces DeepFace through face matching, searching an image directory and facial analysis. Uploaded on January 14, 2024, it shows the library's default settings at that time. The source gives no DeepFace or Python version and no separate recording date.

The speaker starts with a PyCharm project, asks viewers to install DeepFace, and uses image paths to compare two photographs. He explains the verification result and briefly discusses model choice, detector backend and distance metric. He describes DeepFace as open source and consults its GitHub code, but leaves those settings at their defaults for the examples.

Two photographs of the speaker return a match, while photographs of other people return non-matches. A generated image intended to depict him at an older age also returns a non-match. He discusses distance and the displayed threshold of 0.68 as ways to understand that result. These examples demonstrate his results rather than establish general recognition accuracy.

The database example searches a folder of photographs and returns another image of the speaker. The final example produces age, emotion, gender and race classifications. The output includes age 34 and a dominant emotion of happy; the speaker questions the race classification. These are model predictions, and the tutorial does not establish that its reported percentages measure accuracy.