Awesome! The question is, why is it working so smoothly? Causey I wrote the same thing with face_recognition and it only shows 1 frame per second. Is your CPU like really powerful? I tried to run it on GPU but it didn't work!
I changed the project a bit. My aim is to open the door by opening the magnetic lock when the camera sees my face. There is a button in my project. When I press the button, the cv2 library is activated. At this time, when the camera sees my face, I activate the relay for 3 seconds, then the relay turns off. But this relay pull event happens many times. I guess it's a problem like this because it frames my face so many times. What kind of arrangement do I need to take only 1 frame and turn the relay on and off. Thanks for your help..
sir, I am getting following error again & again ---> 43 small_frame = cv2.resize(frame, (0, 0), fx=self.frame_resizing, fy=self.frame_resizing) so please reply sir.
bro, please reply.... When i run the project the videocapture screen is very slow.... its only when the screen recognize a face that it becomes slow... how to solve this?... please help?
Ive noticed a lot of comments here by folks wanting to scale up the recognition to many thousands of images. There are solutions to this but you will need to learn about high performance computing architectures first and that is a field in of itself. But to be honest: if you don't know how to scale this problem then you should question whether you should be even trying, since the legal and ethical issues you may encounter if you get it wrong may land you in serious trouble. Great tutorial though.
This is great, thank you for sharing! I am working on a research project related to real-time facial expression recognition for mental health. Could you post a video that implements facial expression recognition on top of this?
Maybe you can try searching for datasets or collect data of different facial expressions and label them and train a seperate model. And once you detect a face from the video crop the face and feed it to the model which is trained to detect emotions. I'm not sure about this approach but it wud be great if you can give honest feedback to my approach. Thank you
It would be possible by having some hat keeping the webcam a few centimeters from the eye, because otherwise with the eye too far, it won't be precise enough and it would be almost impossible to hit the keys correctly
Anyone else having problems installing dlib? I can't compile it on windows 10. In my Linux Minit install I've successfully compiled and installed the package but can't install the face_recognition_models package...
Indeed a great library for image recognition. But I found that when a person face is slanted in the picture, say 30 degrees then the face_encodings function will get an exception. That is a drawback of this module..., otherwise it does an exellent job for face matching.
It depends on many factors. The speed of your computer, the number of encoding faces and the number of the faces detected simultaneously. The more the faces, the slower it will be
hey im trying to build a face tracking camera using esp32 and i really need to use a face recognition on my computer using its own cpu so can i alter this code to recognize face from given website if so how thank you for reading
Hi Mr Seraio, do u think this library could handle more than one thousand face ? , and if not tell me model or library may will depend on ur experiance.
Good morning sir, how we can acieve attendance recording based on face recognization only from real person face, not by comparing images from showing pic from mobile.
Plz help...i have download the file simple_facerec in the same folder as souce code...but when i try to run sfr.load_encoding_images("images/") it says 0 encoding images....what is the problem?😰😰
There should be more accuracy, and for future do one thing that store encodings in a excel file so that one can have his face encodings and that will help to make face decoders in future.
I agree about the accuracy. I on purpose (reduced the accuracy on this one, by shrinking image size that is processed) to make it in realtime with just the CPU.
Hi Sir! I need your help in my college project. My project is a Door Security System (first the system will recognize the face if face matched then door will open otherwise door remain close). My teacher ask me to create a desktop application for this. But i don't know how to do this. Can you please help me in my project?
Dude, Am working on the exact same project, i think you would need a face recognition code with confidence measured in it. Unfortunatley this code won't work for you
Excuse me sir i do type everthing like you did but when my camera detect my face it just quit itself and show error >> 'str' object is not callable. If i delete the line cv.putText it will works normally i dont know how to fix it
Is there a way to use face tracking and swapping in real time using a live stream video feed, another words not using web cam for my own face, but instead swap anyone's face in real time on obs live stream, i cant seem to find any info if this is possible?
uhm. i have a question. if my application is like open door with face. i want to add more face to open the door. i have to reload encoding face image or something ... ?
Thanks for the tut. How this library recognize the people? when you show a different pics of the same people how it can understand that this is that person? by what technique it compares photos?
Can i ask if there is another way to load the faces pictures? i have a students data (more than 100 faces). it wont be practical if i encode each student in the code. so is there another way for doing it? i have the pictures loaded on mysql phpmyadmin maybe that would help?
So the same thing happened to me and you can fix it quite easily by just typing "pip install cmake" into the terminal just like you did the other pip install commands. As to why we need cmake, this is because the 'face_recognition" package actually takes its functions from those used in the 'dlib' package and the dlib package/lbrary is originally written in C/C++ (dlib is a toolkit for making real world machine learning and data analysis applications in C/C++). Now, even though the dlib library is originally written in C/C++, it has good, easy to use Python bindings, hence why we can run the code using python scripts. This means that we can code using a friendly python interface but with the power and speed of C/C++ code. And in order for dlib to work it needs a compiler which in this case is cmake
🔥Learn how to build your own AI vision solutions: pysource.com/community
what algorithm did you use?
What algorithm did you use
Could you please explain what is the use of "simplefacerec" file that downloaded to accomplish the task
hey can u tell me from where do we download that file
@@chitrakaseri5203 click on blog and and notebook link and download source code
Awesome!
The question is, why is it working so smoothly?
Causey I wrote the same thing with face_recognition and it only shows 1 frame per second.
Is your CPU like really powerful?
I tried to run it on GPU but it didn't work!
You could make the recognition only run on frame modulo 30
I changed the project a bit. My aim is to open the door by opening the magnetic lock when the camera sees my face. There is a button in my project. When I press the button, the cv2 library is activated. At this time, when the camera sees my face, I activate the relay for 3 seconds, then the relay turns off. But this relay pull event happens many times. I guess it's a problem like this because it frames my face so many times. What kind of arrangement do I need to take only 1 frame and turn the relay on and off. Thanks for your help..
Instead of capturing the camera live, have it capture the first or second frame only eg cv2.frame ...
but it might be not good idea to actually put it on home door as it can be open by your picture too
Where is this simple_facerec file?
I searched a lot but didn't find anywhere
[subscribe]: Request for /accounts/1390699/lists/5347472/subscribers did not respond properly.
Getting this error everytime I try to sign in 🧐
sir, I am getting following error again & again
---> 43 small_frame = cv2.resize(frame, (0, 0), fx=self.frame_resizing, fy=self.frame_resizing)
so please reply sir.
Gives an error while importing SimpleFacerec module, any solutions?
Did you find the solution?
bro, please reply.... When i run the project the videocapture screen is very slow.... its only when the screen recognize a face that it becomes slow... how to solve this?... please help?
help us...
is there any progress
run recognition on a seperate thread
@@nihar8783 how?
Enter 0 in waitkey function
the face recognition is pretty slow when it recognizes a face, down to 2 fps only?
any way to solve this, urgent!
did you solve
Sir what's the use of simple facerec file ?
could u work in multiple dataset for on person for make the detection more accurate, this would be great.
where is the link for simple_facerec?????
Help me sir at 8:52 it says Unsupported image type, must be 8bit gray or rgb image
i got the same error. Were you able to resolve this?
This face_recogntition module is getting install on windows os. can you make this module for windows also
Ive noticed a lot of comments here by folks wanting to scale up the recognition to many thousands of images. There are solutions to this but you will need to learn about high performance computing architectures first and that is a field in of itself.
But to be honest: if you don't know how to scale this problem then you should question whether you should be even trying, since the legal and ethical issues you may encounter if you get it wrong may land you in serious trouble.
Great tutorial though.
This is great, thank you for sharing! I am working on a research project related to real-time facial expression recognition for mental health. Could you post a video that implements facial expression recognition on top of this?
Maybe you can try searching for datasets or collect data of different facial expressions and label them and train a seperate model. And once you detect a face from the video crop the face and feed it to the model which is trained to detect emotions. I'm not sure about this approach but it wud be great if you can give honest feedback to my approach. Thank you
Can i use this face recognize method is use to detect somthings like car or object by compare with image data?
What line should we add to this code to tell the recognised person name
its showing unresolved reference face_recognition even after I download face recognition model and util
where to download face_recognition package
Awesome video!!
There would be a way to improve it by recognizing that you're showing a picture or a video and show an error?
You are doing a fantastic job God bless you and increase your ability ❤️
where are the files as u said they are in description
hey im not able to download the code from ur site even after registering
which algorithm is used in this project????
Hello, Its actually giving me a legacy install failure issue for dlib while installing face-recognition library...any solution for this?
Same probleme here
(-215:Assertion failed) !ssize.empty() in function 'cv::resize'
i am facing this error...
How you solved this error
i cant find simple face rec file. where is it?
I have a question, My camera seem to be lagging when it detect one of the dataset. Anyway to make it less laggy like perhaps 60fps?
hello sir, what algorithm do you use? thank you
Hello Sergio.
What kind of camera is this?
from where do i download those 2 py files?
i got a problem, when i run the code. i got error message "Unsupported image type, must be 8bit gray or RGB image."
замени версию numpy на 1.26.0
@Pysource , that simple facerec file , where to get please assist
@pysource is there any way
to write by eye using virtual keyboard on the screen without using blinking?
It would be possible by having some hat keeping the webcam a few centimeters from the eye, because otherwise with the eye too far, it won't be precise enough and it would be almost impossible to hit the keys correctly
Anyone else having problems installing dlib? I can't compile it on windows 10. In my Linux Minit install I've successfully compiled and installed the package but can't install the face_recognition_models package...
Indeed a great library for image recognition. But I found that when a person face is slanted in the picture, say 30 degrees then the face_encodings function will get an exception. That is a drawback of this module..., otherwise it does an exellent job for face matching.
Yes
Not able to download the source code even after verifying my email
Why does it work so fast on your machine? I get a horrendous performance on big_buck_bunny_720p_5mb.mp4 video!
Does it use dlib under the hood?
Why does yours have higher frame rate?
It depends on many factors. The speed of your computer, the number of encoding faces and the number of the faces detected simultaneously. The more the faces, the slower it will be
@@pysource-com oh currently I only have one known_face and only one person on webcam but still has low framerate so I guess it's more on my PC now
@@ber2996 did you solve
@@Tuncaydin0 pc performance is the problem, have to get a better pc
@@ber2996 thank you
Hey excuse me sir please can we use Esp 32 camera module for this project??
what algorithm was used to identify the face?
How can i do this with an external ip camer on same network please? not built in web cam on an rpi4 or anything?
what is your pc specs, i tried the code on my laptop but it slows down when it detects a face
This is magnificent, Thanks for sharing!
Currently i am working on a project in this related topic (Human Face Recognition).
I just tried this and it works perfectly! Thank you so much!
hey im trying to build a face tracking camera using esp32 and i really need to use a face recognition on my computer using its own cpu so can i alter this code to recognize face from given website if so how thank you for reading
Why doesn’t your preview window lag when it recognizes your face? Mine was lagging at about 1-2 frames per second whenever it recognizes faces.
me too have you fixed it?
@@VojtaGaming25 Nope. I think that he has a very good CPU that has 8 cores above or Nvidia RTX 30 series GPU? I'm not really sure.
Hello
can you please help me
I want an algorithme
that tells me if two shapes are the same shape
This is amazing and it works (python 3.7, pip installs), thank you!
Hi Mr Seraio, do u think this library could handle more than one thousand face ?
, and if not tell me model or library may will depend on ur experiance.
Sir, is possible ?. Photo-recognition software catches tigers by their stripes. Already given name to tiger Id
Good morning sir, how we can acieve attendance recording based on face recognization only from real person face, not by comparing images from showing pic from mobile.
Initial i i saw as a good tutorial but why do you make it hard to get the simplefacerec file?
how to overcome "RuntimeError: Unsupported image type, must be 8bit gray or RGB image" , even though I have downloaded the file you shared😔
14:36 if you get an error rey another value for VideoCapture( )
I tried with VideoCapture(0) and it worked
Where do we get that Simple_facerec python file from????
please help idk why i cant install face_recognition and also dlib :'(
Dear Mr. Sergio, which algorithm has been used here? Mention, please.
Plz help...i have download the file simple_facerec in the same folder as souce code...but when i try to run sfr.load_encoding_images("images/") it says 0 encoding images....what is the problem?😰😰
Can you share simple_facerec file ? I am unable to find it.
There should be more accuracy, and for future do one thing that store encodings in a excel file so that one can have his face encodings and that will help to make face decoders in future.
I agree about the accuracy.
I on purpose (reduced the accuracy on this one, by shrinking image size that is processed) to make it in realtime with just the CPU.
@@pysource-com okay, i see, btw you are doing great work.
how can we add an excel sheet in it so that we can keep the track of people that were scanned
I got this probelm operands could not be broadcast together with shapes *(1,16)(128,)*
any idea or video that helps. thanks
does the library accept multiple samples of one face?
my web cam live-video is freezing. its reaction time is very low, what should i do?
Can we modify that code, if a unknown person comes in frot of the camera then it will show the UNKNOWN PERSON?? How to do that?
Hi Sir!
I need your help in my college project. My project is a Door Security System (first the system will recognize the face if face matched then door will open otherwise door remain close). My teacher ask me to create a desktop application for this. But i don't know how to do this. Can you please help me in my project?
Dude, Am working on the exact same project, i think you would need a face recognition code with confidence measured in it. Unfortunatley this code won't work for you
have you made your project by now? @zarafshan Bibi
Pls, how about object recognition? I have a project I'm working on object recognition. Kindly help out
Excuse me sir i do type everthing like you did but when my camera detect my face it just quit itself and show error >> 'str' object is not callable.
If i delete the line cv.putText it will works normally i dont know how to fix it
Bro help me to how to download the face recognition and simple facereck files
Is there a score that describe similarity between the images
Is there a way to use face tracking and swapping in real time using a live stream video feed, another words not using web cam for my own face, but instead swap anyone's face in real time on obs live stream, i cant seem to find any info if this is possible?
uhm. i have a question. if my application is like open door with face. i want to add more face to open the door. i have to reload encoding face image or something ... ?
exactly, you need to write the code in order that stores new encoding faces dinamically once a new face is detected
i have lots of errors installing dlib library , it's unable to install, what should i do?👏
how do i save detections using imwrite function to a folder
How do you use the gpu do do this?
The Rectangle frame is not getting created it throws error at simple_facerec.py file, what should I do????
can you name the tech stacks used?
I don't know I've tried like 4 ways to run face recognition using webcam, all of them lags just when they capture my face !! how to solve this ??
Hi, i have problem with the fps. Mine not smooth as in your vid.
did you solve
Thanks for the tut. How this library recognize the people? when you show a different pics of the same people how it can understand that this is that person? by what technique it compares photos?
why is it when I type pip install opencv, it tells me its not recognized?
Can i ask if there is another way to load the faces pictures? i have a students data (more than 100 faces). it wont be practical if i encode each student in the code. so is there another way for doing it? i have the pictures loaded on mysql phpmyadmin maybe that would help?
can i know what does simple face file contain ?
Amazing tutorial! Worked perfectly! thanks!
which sofware are you using'
pycharm
@@pysource-com okay
What is the algorithm name plz
Could anyone advise, I got it running but it seems like when it detects a face the webcam seems to be so laggy
Does this detect multiple face on same time....
when I do pip install face_recognition it says cmake must be downloaded. what is cmake and why did you not mension anything about it
So the same thing happened to me and you can fix it quite easily by just typing "pip install cmake" into the terminal just like you did the other pip install commands.
As to why we need cmake, this is because the 'face_recognition" package actually takes its functions from those used in the 'dlib' package and the dlib package/lbrary is originally written in C/C++ (dlib is a toolkit for making real world machine learning and data analysis applications in C/C++).
Now, even though the dlib library is originally written in C/C++, it has good, easy to use Python bindings, hence why we can run the code using python scripts. This means that we can code using a friendly python interface but with the power and speed of C/C++ code. And in order for dlib to work it needs a compiler which in this case is cmake
@@Mooseynair thanks for the help 👍
Very Helpful Video For Me, Thanks
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
Is this also able to detect side faces
i cant find module simple_facerec, how to download it
what algorithm did you use?
This is a simple implementation of Facial recognition by the dlib library. You can find out more about the library here: github.com/davisking/dlib
Cv2.imshow("Frame",frame)
Indentation error: doesn't match any outer identification level
How did you calculate accuracy and loss functions by using the face recognition library?
Hi, Have you found how to calculate accuracy? Cuz we're doing a project and we need to have the accuracy but we were stuck in it
@@lolgamer8591 did u get thr solution?
i got errror invalid syntax in img_encoding = face_recognition.face_encodings(rgb_img) [0] why master?
Hi where can i find the simple_facerec file?
is there anyway to just recognize only live face not from picture.
@Pysource we have a problem at line 5