DelphiPythonPython GUIWindows

This Is How To Build A Powerful Face Recognition Windows App

blogbanner3-50

Are you looking for a powerful face detector library and build a nice GUI for them? Try Face Recognition library for Python. To create the GUI you can use the excellent Python4Delphi (P4D). P4D is a free and simple tool that allows you to run Python scripts as well as create new Python modules and types in Delphi.

Face Recognition library-known as the world’s simplest face recognition library, has the capabilities to recognize and manipulate faces using Python or the command line.

Face Recognition is built using dlib’s state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.38% on the Labeled Faces in the Wild benchmark.

This library also provides a simple face_recognition command-line tool that lets us do face recognition on a folder of images from the command line.

This post will guide you on how to recognize all faces in any given image using the Face Recognition library and use Python for Delphi to display it in the Delphi Windows GUI app.

First, open and run our Python GUI using project Demo1 from Python4Delphi with RAD Studio. Then insert the script into the lower Memo, click the Execute button, and get the result in the upper Memo. You can find the Demo1 source on GitHub. The behind the scene details of how Delphi manages to run your Python code in this amazing Python GUI can be found at this link.

0_rundemo1-6813476

Another requirement is, you need to install CMake and dlibs on your computer.

 

Demo

We will test the Face Recognition library to detect faces in this image:

Use the following code to recognize faces from any image, using Histogram of Oriented Gradients (HOG) based model:

The histogram of oriented gradients (HOG) is a feature descriptor used in computer vision and image processing for object detection. The technique counts occurrences of gradient orientation in localized portions of an image.

The usage of the HOG-based model became widespread in 2005 when Navneet Dalal and Bill Triggs, researchers for the French National Institute for Research in Computer Science and Automation (INRIA), presented their supplementary work on HOG descriptors at the Conference on Computer Vision and Pattern Recognition (CVPR). In this work, they focused on pedestrian detection in static images, although since then they expanded their tests to include human detection in videos, as well as to a variety of common animals and vehicles in static imagery.

Here are the outputs of recognized faces by Face Recognition + Python4Delphi:

This Is How To Build A Powerful Face Recognition Windows App - the test
This Is How To Build A Powerful Face Recognition Windows App - another test
This Is How To Build A Powerful Face Recognition Windows App - a third test
This Is How To Build A Powerful Face Recognition Windows App - a fourth test

 

Congratulations, now you have learned how to recognize all faces in any given image using the Face Recognition library and use Python for Delphi to display it in the Delphi Windows GUI app!

Check out the Face Recognition library for Python and use it in your projects: https://pypi.org/project/face-recognition/  and

Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi: https://github.com/pyscripter/python4delphi

close
Related posts
DelphiLearn PythonPythonPython GUIRAD Studio

Why You Should Know About SQLite For Your Windows Apps

Learn PythonPythonPython GUIVideos

How To Make Matplotlib Charts To Visualize Data

DelphiPythonPython GUIWindows

What You Need To Create A Secure Python Password Generator

DelphiPythonPython GUIWindows

How To Make A GUI For Learning Python Using Turtle Library

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish