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..
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!
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.
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.
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?
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
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 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...
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?
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.
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.
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?😰😰
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
you need to go here pysource.com/2021/08/16/face-recognition-in-real-time-with-opencv-and-python/ the link is unlocked and displayed on the blog page after you confirm your email (you do not get it directly to the email)
@@pysource-com Thanks Sergio, now I'm able to finish this project. Thank you for replying, some don't. I think I will subscribe to your courses now. May I suggest that you offer courses on a monthly basis payment (pyimagesource offers that possibility). This will make it easier for some of us to pay as opposed to one big lump sum which is harder to obtain for some. Thank you again !!!
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
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?
If ı want to train the model with mutliple images for messi what should ı do ? Alsho huge thnaks for this video its pretty useful and understandable for who interests opencv newly
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.
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?
Wow the project is great. I would like to know how to connect the project with a Phone or a device for capturing the face then send the Information to the computer for Display
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 ... ?
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
You need some text encodings which will allow you to use that. you can look for arabic text python, and probably there is some library which will convert the text format to be displayed
Great video! I looked for the files that you mentioned to download and i didn't found it. the link in your description takes me to your website with a button to download the source code, but without these files. Can you help me with it?
Just one question, How can i make use of multiple images of a single person, like for example my folder structure is: /images -> person1_folder/image1, image2, image.... person2_folder/image1, image2, image...., So the question is how to generate encodings of these? Like stacking the encodings of similar person? how..
With this code right here, for the way I structured it, it's not possible. You should manually edit the simplefacerec file to change the way the faces for encodings are loaded and group them by people faces
🔥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
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
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
could u work in multiple dataset for on person for make the detection more accurate, this would be great.
Sir what's the use of simple facerec file ?
Gives an error while importing SimpleFacerec module, any solutions?
Did you find the solution?
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, 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.
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 🧐
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.
Help me sir at 8:52 it says Unsupported image type, must be 8bit gray or rgb image
This face_recogntition module is getting install on windows os. can you make this module for windows also
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?
Use GPU nub
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
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?
where is the link for simple_facerec?????
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
This is amazing and it works (python 3.7, pip installs), thank you!
Can i use this face recognize method is use to detect somthings like car or object by compare with image data?
@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
hello sir, what algorithm do you use? thank you
What line should we add to this code to tell the recognised person name
Hello Sergio.
What kind of camera is this?
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...
its showing unresolved reference face_recognition even after I download face recognition model and util
where to download face_recognition package
I just tried this and it works perfectly! Thank you so much!
You are doing a fantastic job God bless you and increase your ability ❤️
(-215:Assertion failed) !ssize.empty() in function 'cv::resize'
i am facing this error...
How you solved this error
which algorithm is used in this project????
This is magnificent, Thanks for sharing!
Currently i am working on a project in this related topic (Human Face Recognition).
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?
Hello, Its actually giving me a legacy install failure issue for dlib while installing face-recognition library...any solution for this?
Same probleme here
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.
Amazing tutorial! Worked perfectly! thanks!
Dear Mr. Sergio, which algorithm has been used here? Mention, please.
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.
hey im not able to download the code from ur site even after registering
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?
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.
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
Very Helpful Video For Me, Thanks
Hey excuse me sir please can we use Esp 32 camera module for this project??
where are the files as u said they are in description
i cant find simple face rec file. where is it?
Amazing tutorial, kindly explain simple facerec code it will be helpful....
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?
14:36 if you get an error rey another value for VideoCapture( )
I tried with VideoCapture(0) and it worked
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
Bro help me to how to download the face recognition and simple facereck files
I got this probelm operands could not be broadcast together with shapes *(1,16)(128,)*
any idea or video that helps. thanks
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?
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
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
from where do i download those 2 py files?
How can i do this with an external ip camer on same network please? not built in web cam on an rpi4 or anything?
Hey Sergio, excellent job sir, but.....how do we import that SimpleFacerec file? The link it's not in the mail box. Or is it? what am I missing?
you need to go here pysource.com/2021/08/16/face-recognition-in-real-time-with-opencv-and-python/
the link is unlocked and displayed on the blog page after you confirm your email (you do not get it directly to the email)
@@pysource-com Thanks Sergio, now I'm able to finish this project. Thank you for replying, some don't. I think I will subscribe to your courses now. May I suggest that you offer courses on a monthly basis payment (pyimagesource offers that possibility). This will make it easier for some of us to pay as opposed to one big lump sum which is harder to obtain for some. Thank you again !!!
what algorithm was used to identify the face?
Hello
can you please help me
I want an algorithme
that tells me if two shapes are the same shape
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
grat job bro ! thanks for the toturial
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.
@Pysource , that simple facerec file , where to get please assist
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?
If ı want to train the model with mutliple images for messi what should ı do ? Alsho huge thnaks for this video its pretty useful and understandable for who interests opencv newly
Sir, is possible ?. Photo-recognition software catches tigers by their stripes. Already given name to tiger Id
Thank you sir it perfectly working
hey can u pls help me out facing a lot of issues downloading the face_recognition libraray?
how did u do it?
AI humanoid robot working. good video for my project. thank sir.
Not able to download the source code even after verifying my email
Is there a score that describe similarity between the images
does the library accept multiple samples of one face?
Pls, how about object recognition? I have a project I'm working on object recognition. Kindly help out
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.
Thank you so much! I finally found a code working for me and my project :) please keep it up
Can u help when i try installing face recognition module it is giving error i am using python 3.8
Hlo can u hel me to download simle_facerec
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?
I like this, i want to be like you
Wow the project is great. I would like to know how to connect the project with a Phone or a device for capturing the face then send the Information to the computer for Display
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
how to overcome "RuntimeError: Unsupported image type, must be 8bit gray or RGB image" , even though I have downloaded the file you shared😔
please help idk why i cant install face_recognition and also dlib :'(
what is your pc specs, i tried the code on my laptop but it slows down when it detects a face
Can you make a tutorial about how to detect a specific person after YOLO-training detecting all people? Thanks
That's an interesting idea. I'll definitely take it into consideration for future videos
@@pysource-com please sir,we will really appreciate it
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
Thanks for sharing..when I add Arabic text instead of English I get question marks ?? What should I fix to display it properly ?
You need some text encodings which will allow you to use that.
you can look for arabic text python, and probably there is some library which will convert the text format to be displayed
my web cam live-video is freezing. its reaction time is very low, what should i do?
please explain the simple facerec file too
i have lots of errors installing dlib library , it's unable to install, what should i do?👏
Hello sir, how to make face recognition with app lock using python interface
Initial i i saw as a good tutorial but why do you make it hard to get the simplefacerec file?
The Rectangle frame is not getting created it throws error at simple_facerec.py file, what should I do????
Great video! I looked for the files that you mentioned to download and i didn't found it. the link in your description takes me to your website with a button to download the source code, but without these files. Can you help me with it?
I couldn't find it either
Where do we get that Simple_facerec python file from????
how can we add an excel sheet in it so that we can keep the track of people that were scanned
Great tutorial and great choice of library. Thanks
Just one question, How can i make use of multiple images of a single person, like for example my folder structure is: /images -> person1_folder/image1, image2, image.... person2_folder/image1, image2, image...., So the question is how to generate encodings of these? Like stacking the encodings of similar person? how..
With this code right here, for the way I structured it, it's not possible. You should manually edit the simplefacerec file to change the way the faces for encodings are loaded and group them by people faces
is this viola jones algorithm??
please for educational purpose
how do i save detections using imwrite function to a folder
can you name the tech stacks used?
can i know what does simple face file contain ?
It was really fabulous
glad to hear that ;)