Jaryd! I follow you on your own UA-cam channel and loved all your videos making crazy stuff. I was shocked to randomly be looking into OpenCV videos to find you doing the tutorial. Love the walkthrough and this core electronics channel already!
I'm stuck, when trying to run the model_training.py, line 3 in the module, no module name face recognition is found.. (error) .. right at minute 6:52. when i get the error message an it runs not super simple (upside down smile)
Lets try and turn the upside down smile, upside down... again. That error means that Thonny can't find the face recognition library. The likely culprit is that there was an issue with setting up Thonny to use the Virtual environment we set up. Try and run the process shown at 4:12 again. If that still doesn't work then there likely was an issue installing the library. Give the installation from the beginnning of the video a go again, might fix it. If all of that fails, feel free to post your issue on our community forum topic for this video, we have a lot of people over there that can help out! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/2
@@Core-Electronics Thanks Jaryd the happiness of locking/unlocking the door with your face was great then "Luke get in here and try to unlock my door" had my Lollerblading ! Keep up the good work, please.
Hey, sorry for the late reply over the Chrissy break, but if you are still having issues, we have a dedicated community forum topic for this video. Feel free to post your issue over there as we have a lot of makers that can help out! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
It may require a bit of reworking to get a webcam going but its definitely possible. In the written guide we have a section on changing the camera resolution as well: core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/#running-facial-recognition
hello sir...May i ask a few question? if i want to take a snapshot whenever someone else(Unknown) person is detected, how the code must be modified? and the same camera(which is used for face recognition) can still be used to take a snapshot of the unknown person?
Hey man great video! do you know how to make the camera follow the pupil? i want to build an eye -tracker using the raspi 5 and raspi moudle 3 thank you so much
can I detect playing cards using this code? for example I take a photo of queen of spade. and when I run facial_recognition_hardware.py and put queen of spade on camera it will print detected
Unfortunately this library is only able to do human faces. Your best bet may be to run object detection with a custom model. We have the "running object detection" part of that, but not the custom model part yet unfortunately. ua-cam.com/video/XKIm_R_rIeQ/v-deo.html
That seems to be a different project with different installations. That project seems to be an add on for a specific smart mirror setup, but this is a "how to set up facial recogntiion in Python to add to your custom project" sort of deal.
This code is untested on a webcam, but it should be possible. The colours may be off though as depending on your webcam, it may use a different colour space, so it may need a bit of tweaking to get the colours right!
First off THANK YOU! The first tutorial that has gotten me to successfully run the camera! It worked with the image capture just fine, and created a data folder. BUT when I try to run image_capture.py I get a file not found error: No such file or directory: ‘encoding.pickle’ Is there a pickle library I forgot to install???
Hey, sorry for the late reply over the Chrissy break, but if you are still having issues, we have a dedicated community forum topic for this video. Feel free to post your issue over there as we have a lot of makers that can help out! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them. guys can you help to solve the error i am facing to install face recognition librarie in my raspberry pi 5
I had that error on the last package that needed to be installed… did it over and over… I rebooted my system and tried again and it loaded just fine … hope this helps
We have found that its not as flexible as this in terms of running it in a Python script. And while it does a lot of other computer vision tasks really well, you might be out of luck on face recognition. Right now its not very possible to just type in a line and off-load the processing to it, you need to find a model and then go through the conversion process to get it in the model format it accepts. So if you could find a compatible face recognition model and convert it, that might be possible. But as of now it might not be possible.
I did install the face recognition library which took more than 30 mins .. however iam not able to see this zip file in downloads.. tried to download it again but pi says Requirement already satisfied.. is there a way to know where this library might be saved it?
Hey, the Zip folder is on the written guide page, you can find it here: core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/#code-download
@@Core-Electronics iam using a camera which has autofocus capability.. when i run the imagecapture .py the video / image is blurred... is there any changes in the code that i need to do in this file to enable my camera with autofocus ?.
The AI Camera has its own workflows and needs its own custom model format so unfortunately its not as simple as plugging it in and running this off it. 😞
So.. Everything is going fine. But on the final face recognition file (to live test it) its giving me an Error with no module named nupy._core what can I possibly do here?
We haven't seen anyone with that issue before, but it sounds like it may be something to do with virtual environments. Double-check that Thonny is set up in the venv we installed the packages into, from memory I don't think the first 2 scripts use any libraries and its the 3rd that does. If that doesn't work we have a dedicated forum topic for this video, feel free to post your issue over there as we have an army of makers that can help! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/2
Hey thank you for making these videos, just subscribed. I need about 5 of these kits and I'm hesitant to order this for real facial recognition. If I'm right, this doesn't distinct if the scanned face is real or the user putting a a photo in front of the camera. For this case, do you know any devkit like this but with some sort of 3D scanner that allows real facial recognition? Thanks!
I haven't tried it but I'm fairly certain this will be tricked by a printed photo of someone. When you get into 3d scanning it starts to get quite involved as well. There are some projects like this: pypi.org/project/pifacecam/ That use a 2 camera setup to fight against printed images, but we don't have a guide for that unfortunately.
Hmmm, I haven't come across that issue. If you are still having problems, feel free to post it on our forum topic for this post. Just give us your code and setup, as well as the error message. We do most of our technical support over there! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
I'm stuck in the installation part where I have to install facial recognition. It has been In the step where it says building wheel for dlib (setup.py). It just keeps showing / and - and |
You can use the camera part of the AI camera as it can function like a regular Pi camera module, but you won't be able to use the onboard AI chip to speed this up. There is a different workflow and system for using the AI camera's processing power 😢
We have a forum topic for this video, there may be some helpful information in there and if not, feel free to post your issue there with some details! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/21
All the code is on our written guide and you can find a download link to all the files at the end of the first paragraph: core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/
This code is untested on a webcam, but it should be possible. The colours may be off though as depending on your webcam, it may use a different colour space, so it may need a bit of tweaking to get the colours right!
Hi, thank you for the video, i could finally dip a toe in live image recognition and yolo. I found one thing - when installing ultralytics, just use pip install ultralytics, not the pip install ultralytics[export]. Export version took too long to install, was installing seems unneeded packages. Program works same with just ultralytics package. Tested on Pi 4 and Pi 5.
I've been trying to attempt this tutorial. I'm using a 8 GB RAM raspberry pi on a 250GB SD card and the interface keeps on crashing on me. And I'm having storage issues due to the size of Tensor Flow and OpenCV. Any suggestions on how to mitigate this issue?
That is very odd, OpenCV and Tensor Flow barely push into the Gigabyte range and I had no issues with this on a 32GB SD card. Is your SD card having issues? We don't do much support over UA-cam, but we have a forum topic for this video that you can post to, we have lots of makers who can help out! Just give us a bit more info about which interface keeps crashing, and maybe some error messaged about your storage issues. forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
Hey, the file is in the written guide (at the end of the very first paragraph): core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/ and this will work with a laptop webcam, but the colours might be mixed up depending on what webcam you are using, its possible to correct it in the code though it will all depend on what webcam you use.
K but my dumbass can't figure how to use the webcam pls tell me how to solve it , it says in thonny when I run the image capture script it says no module found cv2
That issue is less camera related and more the Pi not being able to dind the OpenCV library. Either there was an issue with the installation, or Thonny isn't set up to use the virtual environment we installed the packages into. We have a guide on using virtual environments here: core-electronics.com.au/guides/raspberry-pi/raspberry-pi-virtual-environments/ And if you still have issues, feel free to chuck a post on our community forum topic for this guide. We have lots of makers over there that can help! forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
Hey, thanks my open cv is working but I keep running in a problem there is a error capture_photots(PERSON_NAME) AND , picam2 = picamera2() And camera_num = self.global_camera_info()[camera_num][num] And last index error : inder out of range Pls help me solve out these and tell me where to replace anything like where to replace word name and put my name , and pls tell me how to use laptops webcam with raspberry pi pls give me the code
JUST got this built and working. Couple questions: - Is there a relatively simple way for it to capture a pic for unrecognized faces (at a limit of 1 a minute or something sane?) - I'd really like to set up a "once X has been in frame for a couple seconds, shoot a command off" function. (I want it to play a greeting file for people who's pictures I've trained it on, for instance.) It's 12:30 am and I'm about to start spelunking in to docs, but I'm getting a little loopy so I figured I'd ask here just in case.
If you still need a hand, large language models like ChatGPT and Claude are very good at writing Python code. If you past in the entire script, as well as any questions or things you want it to do, they should be able to write it and explain it for your. They are free to use nowadays as well which is amazing!
@@Core-Electronics Oh I'm good, thanks. I was a little loopy because I was working on this at about 2:30 in the morning. A good night's sleep knocked the dust off my head. :)
You can find it on our written guide page core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/ But here is a direct link as well! core-electronics.com.au/attachments/uploads/facial-recognition-updated.zip
Hi Grate video well explained thanks got it woking if any one follows this guild wait along time before running image talking part I had my dinner and a cup of coffee waiting for it to load opencv .
You have brilliantly explained so much, so well, in 12 minutes.
Folks have no idea how long this takes to do well!
Thank you very much for the kind words, hope you enjoyed!
Jaryd! I follow you on your own UA-cam channel and loved all your videos making crazy stuff. I was shocked to randomly be looking into OpenCV videos to find you doing the tutorial. Love the walkthrough and this core electronics channel already!
I am just equally as shocked to get people from that channel recognising me here! 💜
thanks a lot sir, i have been looking for this for about 5 days for a project ...(a new subscriber here)🤗
at last , i also did it !!!😃
Great Tutorial for 12 minutes completely worth it
where is the code?
my teacher suggested me this channel, this is really helpfull. Thank you!
No worries!
Fantastic tutorial! This video was very easy to follow!
Great guide. Please keep up the good works. I really appreciate your effort.
This was legit an awesome tutorial
you got yourself a subscriber
Dude, you rule, great video
Also, Luke is pleasantly menacing; he is a good foil and i look forward to watching more videos!
Great videos!
I'm stuck, when trying to run the model_training.py, line 3 in the module, no module name face recognition is found.. (error) .. right at minute 6:52. when i get the error message an it runs not super simple (upside down smile)
Lets try and turn the upside down smile, upside down... again. That error means that Thonny can't find the face recognition library. The likely culprit is that there was an issue with setting up Thonny to use the Virtual environment we set up. Try and run the process shown at 4:12 again.
If that still doesn't work then there likely was an issue installing the library. Give the installation from the beginnning of the video a go again, might fix it.
If all of that fails, feel free to post your issue on our community forum topic for this video, we have a lot of people over there that can help out!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/2
@@Core-Electronics Thanks Jaryd the happiness of locking/unlocking the door with your face was great then "Luke get in here and try to unlock my door" had my Lollerblading ! Keep up the good work, please.
You rock! Thanks a lot
4:43 I don’t have a “face recognition 7z” file does anyone know why?
Hey, sorry for the late reply over the Chrissy break, but if you are still having issues, we have a dedicated community forum topic for this video. Feel free to post your issue over there as we have a lot of makers that can help out!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
Hi can i use a usb camera to work with opencv recognition its working great with raspi camera module ist a very large picture how can make it smaller
It may require a bit of reworking to get a webcam going but its definitely possible. In the written guide we have a section on changing the camera resolution as well: core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/#running-facial-recognition
hello sir...May i ask a few question? if i want to take a snapshot whenever someone else(Unknown) person is detected, how the code must be modified? and the same camera(which is used for face recognition) can still be used to take a snapshot of the unknown person?
Sold out ✌️
Hey man great video!
do you know how to make the camera follow the pupil?
i want to build an eye -tracker using the raspi 5 and raspi moudle 3
thank you so much
can I detect playing cards using this code? for example I take a photo of queen of spade. and when I run facial_recognition_hardware.py and put queen of spade on camera it will print detected
Unfortunately this library is only able to do human faces. Your best bet may be to run object detection with a custom model. We have the "running object detection" part of that, but not the custom model part yet unfortunately.
ua-cam.com/video/XKIm_R_rIeQ/v-deo.html
How is this any different from the GitHub project for the magic mirror “MMM-Face-Recognition-SMAI”? Are the installations any different?
That seems to be a different project with different installations. That project seems to be an add on for a specific smart mirror setup, but this is a "how to set up facial recogntiion in Python to add to your custom project" sort of deal.
For some reason for me it says when I am opening the model training file that "No module name face_recognition" What should I do?
Nevermind I just ran it again and it worked. Thanks for you work jaryd!
Hi, can I use a external usb webcam ?
This code is untested on a webcam, but it should be possible. The colours may be off though as depending on your webcam, it may use a different colour space, so it may need a bit of tweaking to get the colours right!
First off THANK YOU! The first tutorial that has gotten me to successfully run the camera! It worked with the image capture just fine, and created a data folder. BUT when I try to run image_capture.py I get a file not found error:
No such file or directory: ‘encoding.pickle’
Is there a pickle library I forgot to install???
Hey, sorry for the late reply over the Chrissy break, but if you are still having issues, we have a dedicated community forum topic for this video. Feel free to post your issue over there as we have a lot of makers that can help out!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them. guys can you help to solve the error i am facing to install face recognition librarie in my raspberry pi 5
how you can fix that? ( if it have been fixed)
i am also having that error :(
@@facundoibietaserafini4191 i ve fixed that downloading library and installing from archieve. Cause of my error was low speed of internet
I had that error on the last package that needed to be installed… did it over and over… I rebooted my system and tried again and it loaded just fine … hope this helps
Is it possible if I use raspberry pi 4 model b on this project?
Yeah. But take care on proper cooling..
awesome video man! By any chance have you tested something like this using the Hailo npu hat for raspberry??
We have found that its not as flexible as this in terms of running it in a Python script. And while it does a lot of other computer vision tasks really well, you might be out of luck on face recognition. Right now its not very possible to just type in a line and off-load the processing to it, you need to find a model and then go through the conversion process to get it in the model format it accepts. So if you could find a compatible face recognition model and convert it, that might be possible. But as of now it might not be possible.
I did install the face recognition library which took more than 30 mins .. however iam not able to see this zip file in downloads.. tried to download it again but pi says Requirement already satisfied.. is there a way to know where this library might be saved it?
Hey, the Zip folder is on the written guide page, you can find it here:
core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/#code-download
@@Core-Electronics thanks a lot mate... this surely helped a lot.. 🙂
@@Core-Electronics iam using a camera which has autofocus capability.. when i run the imagecapture .py the video / image is blurred... is there any changes in the code that i need to do in this file to enable my camera with autofocus ?.
Please make a video on pose detection with the same setup
Hi Jaryd, great video. If I upgrade to a Pi AI Camera, does this still work?
The AI Camera has its own workflows and needs its own custom model format so unfortunately its not as simple as plugging it in and running this off it. 😞
@@Core-Electronics Hello, will it be possible to run models like facenet on the new AI camera?
So.. Everything is going fine. But on the final face recognition file (to live test it) its giving me an Error with no module named nupy._core what can I possibly do here?
We haven't seen anyone with that issue before, but it sounds like it may be something to do with virtual environments. Double-check that Thonny is set up in the venv we installed the packages into, from memory I don't think the first 2 scripts use any libraries and its the 3rd that does.
If that doesn't work we have a dedicated forum topic for this video, feel free to post your issue over there as we have an army of makers that can help!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/2
Hey thank you for making these videos, just subscribed. I need about 5 of these kits and I'm hesitant to order this for real facial recognition.
If I'm right, this doesn't distinct if the scanned face is real or the user putting a a photo in front of the camera.
For this case, do you know any devkit like this but with some sort of 3D scanner that allows real facial recognition?
Thanks!
I haven't tried it but I'm fairly certain this will be tricked by a printed photo of someone. When you get into 3d scanning it starts to get quite involved as well. There are some projects like this:
pypi.org/project/pifacecam/
That use a 2 camera setup to fight against printed images, but we don't have a guide for that unfortunately.
can i run raspi 3 ? 1gb
We found that we needed more than 1GB of RAM, and it was already slow on a Pi 4. But if you have a Pi 3 already, give it a go! It might work!
hi after running the face recgonition code in thonny it is showing "list index out of range " error please help
Hmmm, I haven't come across that issue. If you are still having problems, feel free to post it on our forum topic for this post. Just give us your code and setup, as well as the error message. We do most of our technical support over there!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
I think I have just encountered the same issue! My camera wasn't plugged in correctly and I received (possibly) the same error message.
Did you solve this , I have been facing the same error
@@Core-Electronics i have been receiving the same error. Is there another problem ir is it mainly my camera's connection
@@Core-Electronics Sir even I am facing the same issue. If you find any solution for this please do tell us
I'm stuck in the installation part where I have to install facial recognition. It has been In the step where it says building wheel for dlib (setup.py). It just keeps showing / and - and |
restart and try again, worked for me
Will this work with the AI camera?
You can use the camera part of the AI camera as it can function like a regular Pi camera module, but you won't be able to use the onboard AI chip to speed this up. There is a different workflow and system for using the AI camera's processing power 😢
i am facing issue to install face recongni tion
We have a forum topic for this video, there may be some helpful information in there and if not, feel free to post your issue there with some details!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033/21
But the thing is that why is it so slow i have done it with dlib it is extremely slow
i want the code and how can i upload the code to raspberry pi?
All the code is on our written guide and you can find a download link to all the files at the end of the first paragraph:
core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/
is it possible if using webcam?
This code is untested on a webcam, but it should be possible. The colours may be off though as depending on your webcam, it may use a different colour space, so it may need a bit of tweaking to get the colours right!
@Core-Electronics oooh i get it, thank you so much for your explainationn
Can I use it with Raspberry AI kit?
Hi, thank you for the video, i could finally dip a toe in live image recognition and yolo. I found one thing - when installing ultralytics, just use pip install ultralytics, not the pip install ultralytics[export]. Export version took too long to install, was installing seems unneeded packages. Program works same with just ultralytics package. Tested on Pi 4 and Pi 5.
The [export] on the end is just to make it more thorough, we ran into some issues without it on specific setups. But if it works without it, it works!
hello. Can I get the code ? thank you
Links in the description 👍
nice one altho my pi takes already like 1 hour installing the opencv-python. Anyone knows why this happens?
I tried the model, and when I turn it on, it works, but when it reveals my face, the image freezes. Why?
I've been trying to attempt this tutorial. I'm using a 8 GB RAM raspberry pi on a 250GB SD card and the interface keeps on crashing on me. And I'm having storage issues due to the size of Tensor Flow and OpenCV. Any suggestions on how to mitigate this issue?
That is very odd, OpenCV and Tensor Flow barely push into the Gigabyte range and I had no issues with this on a 32GB SD card. Is your SD card having issues?
We don't do much support over UA-cam, but we have a forum topic for this video that you can post to, we have lots of makers who can help out! Just give us a bit more info about which interface keeps crashing, and maybe some error messaged about your storage issues.
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
Hello i got 2 questions 1. Where to download the face recognition file and 2. Can we use our laptops webcam ? Pls answer asap ❤❤
Hey, the file is in the written guide (at the end of the very first paragraph):
core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/
and this will work with a laptop webcam, but the colours might be mixed up depending on what webcam you are using, its possible to correct it in the code though it will all depend on what webcam you use.
K but my dumbass can't figure how to use the webcam pls tell me how to solve it , it says in thonny when I run the image capture script it says no module found cv2
That issue is less camera related and more the Pi not being able to dind the OpenCV library. Either there was an issue with the installation, or Thonny isn't set up to use the virtual environment we installed the packages into.
We have a guide on using virtual environments here:
core-electronics.com.au/guides/raspberry-pi/raspberry-pi-virtual-environments/
And if you still have issues, feel free to chuck a post on our community forum topic for this guide. We have lots of makers over there that can help!
forum.core-electronics.com.au/t/face-recognition-with-raspberry-pi-and-opencv/21033
Hey, thanks my open cv is working but I keep running in a problem there is a error capture_photots(PERSON_NAME)
AND , picam2 = picamera2()
And camera_num = self.global_camera_info()[camera_num][num]
And last index error : inder out of range
Pls help me solve out these and tell me where to replace anything like where to replace word name and put my name , and pls tell me how to use laptops webcam with raspberry pi pls give me the code
thx
JUST got this built and working. Couple questions:
- Is there a relatively simple way for it to capture a pic for unrecognized faces (at a limit of 1 a minute or something sane?)
- I'd really like to set up a "once X has been in frame for a couple seconds, shoot a command off" function. (I want it to play a greeting file for people who's pictures I've trained it on, for instance.)
It's 12:30 am and I'm about to start spelunking in to docs, but I'm getting a little loopy so I figured I'd ask here just in case.
Okay so...calculated fps x number of repeated frames with face_encoding...okay, I think I've got that.
If you still need a hand, large language models like ChatGPT and Claude are very good at writing Python code. If you past in the entire script, as well as any questions or things you want it to do, they should be able to write it and explain it for your. They are free to use nowadays as well which is amazing!
@@Core-Electronics Oh I'm good, thanks. I was a little loopy because I was working on this at about 2:30 in the morning. A good night's sleep knocked the dust off my head. :)
Where is the code
You can find it on our written guide page
core-electronics.com.au/guides/raspberry-pi/face-recognition-with-raspberry-pi-and-opencv/
But here is a direct link as well!
core-electronics.com.au/attachments/uploads/facial-recognition-updated.zip
Can you make tutorial using Face Recognition as attendance?
Najs
Hi Grate video well explained thanks got it woking if any one follows this guild wait along time before running image talking part I had my dinner and a cup of coffee waiting for it to load opencv .
Guys anyone here knows how to connect the capture_photos() to a Qt5 btn without conflicts?
Im having problem with the cv2. Imshow and qt5