How Face Recognition Works with Deep Learning in Python

preview_player
Показать описание
This is a hands-on face recognition workshop from scratch in python. In this episode, we are going to mention how face recognition works within deep learning and common stages of a modern face recognition pipeline.

Modern face recognition pipelines consist of 4 common stages: detect, align, represent and verify.

The both detection and alignment can be handled by common packages such as opencv or dlib. Those packages use adaboost algorithm in the background. It is a legacy boosted tree.

We feed face images to a convolutional neural network and extract its vector embedding in representation step. Herein, the most common face recognition models are VGG-Face, Google FaceNet, OpenFace, Facebook DeepFace, ArcFace, DeepID and Dlib. These models were built to classify face pictures on a large scale data set. We use its early layers to represent.

Then, verification step finds distances between two vectors found in the representation step. Herein, euclidean distance and cosine similarity are the most common methods to compare vectors. Pictures of a same person should have a small distance whereas pictures of different person should have a large distance.

We will use pre-built face recognition models provided by deepface framework for python. You can install deepface with calling "pip install deepface" command.

Want more? Connect with me here:

If you do like my videos, you can support my effort with your financial contributions on
Рекомендации по теме
Комментарии
Автор

Hey thanks for this. I am trying to do face recognition with high quality images. But it takes a lot more time for the embeddings to be generated.
Also in the deepface.find() function is there a possible way to use images folder from cloud in the db_path rather than a local storage path

AkashSuresh-go
Автор

Thanks lot❣️❣️I was waiting for this video

radhikapatil
Автор

Hey! i got a doubt in your "face recognition using open face".You said in your blog that the idle threshold value is "OpenFace show that distance threshold for the model should be 0.02 for cosine and 0.20 for euclidean distance.",
But in your real time video implementation code the threshold value is 0.45 for cosine and 0.95 for euclidean, am confused.

salvindsouza
Автор

I tried to run deepface from manjaro and windows, on both ends i get errors. Any way to contact you via chat? Discord or something?

i got the dataset directory right there in the /test path, which i'm running the script from.

python face-recognition-how.py
#

model input shape: []
model output shape: 2622
Traceback (most recent call last):
File "E:/ml/deepface/tests/face-recognition-how.py", line 24, in <module>
img1 = functions.detectFace("dataset/img1.jpg", input_shape)
File "C:\Users\q\AppData\Local\Programs\Python\Python37\lib\site-packages\deepface\commons\functions.py", line 334, in detectFace
raise ValueError("Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.")
ValueError: Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.

deephousefridays
Автор

whatever process mentioned in the video is face verification. You get a real time image, You claim that you are so and so, just like your mobile phone, you calculate distance between the embeddings stored for that claimed person and the real time image, and then say yes/no. Based on that you can take some decision of authentication or granting access to phone or bank account or whatever. This is not face recognition.

Face recognition I understand is an extension of this. We calculate distances with all embeddings, and then based on some criteria identify the user. But doesn't that complicate the problem as we have distances from so many other uses. There is a chance, a user with similar features will have less distance than the actual user. As soon as we use these models for a genuine large face recognition tasks, won't real accuracy get impacted ???

Need your thoughts on this.

kartikpodugu
Автор

detectFace fonksiyonu için " module 'deepface.commons.functions' has no attribute 'detectFace'" hatasını alıyorum. Sebebini biliyor musunuz ?

onurakkose
Автор

can I capture images from a security camera in real time and do facial recognition?

ellyakinkin