Hi folks,
I would like to build a face recognition system with OpenCV or Python / dlib.
Than determine the vectors (embeddings) of the recognized faces and save them in a vectore database like chromaDB.
And thus have the possibility to compare faces e.g. with Cosine Similarity.
In other words, in the same way that https://facecheck.id/ is breathtakingly fast and effective.
This is what ChatGPT suggested to me.
Now my actual question: who is already familiar with this area? How would you do it?
In the forum there are already codes to recognize faces via the Windows API or from JHP JHP a face recognition with OpenCV.
How would you determine the face vectors?
Is it a good idea to do the whole thing using RunProgram() and Python?
I appreciate any tips! Thanks!!!
Ciao Dige
Exchange on Face recognition and Face comparison
Exchange on Face recognition and Face comparison
"Daddy, I'll run faster, then it is not so far..."
Re: Exchange on Face recognition and Face comparison
Yes, you're may run deepface on Python
https://github.com/serengil/deepface
Last released on Aug 17, 2024
Works well, every model about 500 MB (gender, race, age)
And maybe anybody transfer this project to PB once
https://github.com/serengil/deepface
Last released on Aug 17, 2024
Works well, every model about 500 MB (gender, race, age)
And maybe anybody transfer this project to PB once
Re: Exchange on Face recognition and Face comparison
Thank you Sergey, Deepface looks very promising. Let's see if I can get it to run on Windows.
"Daddy, I'll run faster, then it is not so far..."
Re: Exchange on Face recognition and Face comparison
-Update-
Wow, that's fantastic!
Recognizing faces, age, emotion etc. works very well.
If you want to try it out (under Windows).
I have Python 3.12. Python installed -> https://www.python.org/downloads/
Make sure you select “Add Python to PATH” when installing!
Open a command prompt (CMD) or PowerShell and create a virtual environment:
python -m venv deepface_env
cd deepface_env
Scripts\activate
DeepFace requires some Python libraries. Install them with:
pip install deepface
I then had to install tf_keras manually:
pip install tf-keras
Now try out Deepface
Start Python
from deepface import DeepFace
result = DeepFace.analyze(“C:\\temp\\test.jpg”, actions=['age', 'gender', 'emotion', 'race'])
print(result)
Next I will try to encapsulate this with PureBasic and process the recognized faces and their characteristics
Wow, that's fantastic!
Recognizing faces, age, emotion etc. works very well.
If you want to try it out (under Windows).
I have Python 3.12. Python installed -> https://www.python.org/downloads/
Make sure you select “Add Python to PATH” when installing!
Open a command prompt (CMD) or PowerShell and create a virtual environment:
python -m venv deepface_env
cd deepface_env
Scripts\activate
DeepFace requires some Python libraries. Install them with:
pip install deepface
I then had to install tf_keras manually:
pip install tf-keras
Now try out Deepface
Start Python
from deepface import DeepFace
result = DeepFace.analyze(“C:\\temp\\test.jpg”, actions=['age', 'gender', 'emotion', 'race'])
print(result)
Next I will try to encapsulate this with PureBasic and process the recognized faces and their characteristics
"Daddy, I'll run faster, then it is not so far..."
Re: Exchange on Face recognition and Face comparison
This would be fantastic!dige wrote: Tue Mar 11, 2025 10:04 am Next I will try to encapsulate this with PureBasic and process the recognized faces and their characteristics

Re: Exchange on Face recognition and Face comparison
I knew that you would like itdige wrote: Tue Mar 11, 2025 10:04 am Wow, that's fantastic!
Recognizing faces, age, emotion etc. works very well.
It also very simple to use
And it has many face detectors, try each of them
I wish you success in the adaptation of DeepFace on Purebasic

Re: Exchange on Face recognition and Face comparison
Dropping a quick update:
Got some solid progress:
Importing an entire image directory
Extracting faces
Analyzing age, emotions, race & generating embeddings
Embeddings are stored in ChromaDB
Face search now works – can find faces & measure similarity
So far, everything's still running purely in Python and its very slow
Next step: PureBasic will handle everything on a meta level.
Got some solid progress:
So far, everything's still running purely in Python and its very slow

"Daddy, I'll run faster, then it is not so far..."
Re: Exchange on Face recognition and Face comparison
I'm not a lawyer, but detecting emotions with an AI is restricted by a brand new EU AI Act. I think. I'm not a lawyer.
Re: Exchange on Face recognition and Face comparison
You are right, but its ok for private use
"Daddy, I'll run faster, then it is not so far..."