DelphiPythonPython GUIWindows

This Is How To Build A Powerful Face Recognition Windows App

blogbanner3 50

Do you want to use a powerful Face Detector Library and build a Windows App using Python Build Tools? Try Face Recognition library for Python. 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.

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.

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:

This Is How To Build A Powerful Face Recognition Windows App some faces to recognize
Image Source <a href=httpsmultifilespressheraldcomuploadssites10202012People People of the Year 26556jpg target= blank rel=noreferrer noopener data rel=lightbox image 0 data rl title= data rl caption= title=>httpsmultifilespressheraldcomuploadssites10202012People People of the Year 26556jpg<a>

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

Related posts
CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Matplotlib Library?

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Pillow Library?

CodeDelphiDelphiFMXLearn PythonProjectsPythonPython GUI

How To Create A Weather App With The Python Delphi Ecosystem and Weatherstack API

CodeDelphiDelphiFMXLearn PythonProjectsPythonPython GUI

How To Create A Music Player With The Python Delphi Ecosystem

Leave a Reply

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