Face recognition in real-time | with Opencv and Python

Поділитися
Вставка
  • Опубліковано 2 січ 2025

КОМЕНТАРІ • 356

  • @pysource-com
    @pysource-com  2 роки тому +9

    🔥Learn how to build your own AI vision solutions: pysource.com/community

    • @rheaynah
      @rheaynah 2 роки тому

      what algorithm did you use?

    • @trick_bros
      @trick_bros 2 роки тому

      What algorithm did you use

  • @gantagayatri1251
    @gantagayatri1251 2 роки тому +16

    Could you please explain what is the use of "simplefacerec" file that downloaded to accomplish the task

    • @chitrakaseri5203
      @chitrakaseri5203 Рік тому +1

      hey can u tell me from where do we download that file

    • @Ganbold121
      @Ganbold121 2 місяці тому

      ​@@chitrakaseri5203 click on blog and and notebook link and download source code

  • @omidalekasir4736
    @omidalekasir4736 2 роки тому +13

    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!

    • @droost2477
      @droost2477 6 місяців тому +1

      You could make the recognition only run on frame modulo 30

  • @serkankaracan9014
    @serkankaracan9014 3 роки тому +10

    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..

    • @Gh0st_0723
      @Gh0st_0723 2 роки тому

      Instead of capturing the camera live, have it capture the first or second frame only eg cv2.frame ...

    • @SahilSingh-zh6ee
      @SahilSingh-zh6ee 2 роки тому +1

      but it might be not good idea to actually put it on home door as it can be open by your picture too

  • @jaiminjariwala5
    @jaiminjariwala5 Рік тому +2

    Where is this simple_facerec file?
    I searched a lot but didn't find anywhere

    • @jaiminjariwala5
      @jaiminjariwala5 Рік тому +1

      [subscribe]: Request for /accounts/1390699/lists/5347472/subscribers did not respond properly.
      Getting this error everytime I try to sign in 🧐

  • @Ravikumar-dv1jz
    @Ravikumar-dv1jz 2 роки тому +7

    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.

  • @gabbark
    @gabbark Рік тому +3

    Gives an error while importing SimpleFacerec module, any solutions?

  • @Manu-vv4ef
    @Manu-vv4ef 3 роки тому +19

    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?

  • @abdulrehmany5309
    @abdulrehmany5309 3 роки тому +5

    the face recognition is pretty slow when it recognizes a face, down to 2 fps only?
    any way to solve this, urgent!

  • @suryakanth5370
    @suryakanth5370 2 роки тому +4

    Sir what's the use of simple facerec file ?

  • @fadhelalsuwaidi1221
    @fadhelalsuwaidi1221 3 роки тому +13

    could u work in multiple dataset for on person for make the detection more accurate, this would be great.

  • @aradhyakumarchandra8900
    @aradhyakumarchandra8900 8 місяців тому +3

    where is the link for simple_facerec?????

  • @evstark
    @evstark 2 місяці тому +1

    Help me sir at 8:52 it says Unsupported image type, must be 8bit gray or rgb image

    • @deekshasharma9640
      @deekshasharma9640 13 днів тому

      i got the same error. Were you able to resolve this?

  • @anshucodevita7752
    @anshucodevita7752 3 роки тому +2

    This face_recogntition module is getting install on windows os. can you make this module for windows also

  • @cgoody3170
    @cgoody3170 2 роки тому +2

    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.

  • @selenawilliams5051
    @selenawilliams5051 Рік тому +7

    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?

    • @harshans7712
      @harshans7712 5 місяців тому +1

      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

  • @GolemTH9
    @GolemTH9 3 роки тому +1

    Can i use this face recognize method is use to detect somthings like car or object by compare with image data?

  • @niteeshanithi906
    @niteeshanithi906 2 роки тому +2

    What line should we add to this code to tell the recognised person name

  • @rheyasharma2548
    @rheyasharma2548 Рік тому

    its showing unresolved reference face_recognition even after I download face recognition model and util
    where to download face_recognition package

  • @vianayyasmin
    @vianayyasmin 2 місяці тому +1

    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?

  • @aiforyounow
    @aiforyounow 3 роки тому +10

    You are doing a fantastic job God bless you and increase your ability ❤️

  • @kartiksharma674
    @kartiksharma674 2 роки тому +1

    where are the files as u said they are in description

  • @t.r.abhishekkasturi9616
    @t.r.abhishekkasturi9616 Рік тому +1

    hey im not able to download the code from ur site even after registering

  • @POOJAKUMARI-gy2ys
    @POOJAKUMARI-gy2ys 3 роки тому +1

    which algorithm is used in this project????

  • @sarthaksonpatki136
    @sarthaksonpatki136 2 роки тому +1

    Hello, Its actually giving me a legacy install failure issue for dlib while installing face-recognition library...any solution for this?

  • @samahashabbir6584
    @samahashabbir6584 2 роки тому +2

    (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
    i am facing this error...

  • @rayatopia
    @rayatopia Рік тому +1

    i cant find simple face rec file. where is it?

  • @thatza547
    @thatza547 11 місяців тому

    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?

  • @rover1615
    @rover1615 3 роки тому +1

    hello sir, what algorithm do you use? thank you

  • @drewenia
    @drewenia 3 роки тому +1

    Hello Sergio.
    What kind of camera is this?

  • @yami_no_ember
    @yami_no_ember 2 роки тому +1

    from where do i download those 2 py files?

  • @alfitodwitama9534
    @alfitodwitama9534 3 місяці тому +1

    i got a problem, when i run the code. i got error message "Unsupported image type, must be 8bit gray or RGB image."

  • @wilsonnkhata1020
    @wilsonnkhata1020 8 місяців тому

    @Pysource , that simple facerec file , where to get please assist

  • @moonx2516
    @moonx2516 3 роки тому +1

    @pysource is there any way
    to write by eye using virtual keyboard on the screen without using blinking?

    • @pysource-com
      @pysource-com  3 роки тому +1

      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

  • @erickruhcardozo
    @erickruhcardozo 3 місяці тому +1

    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...

  • @henkhbit5748
    @henkhbit5748 3 роки тому +5

    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.

  • @xavier144
    @xavier144 Рік тому +1

    Not able to download the source code even after verifying my email

  • @eduardmart1237
    @eduardmart1237 2 роки тому

    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?

  • @ber2996
    @ber2996 3 роки тому +2

    Why does yours have higher frame rate?

    • @pysource-com
      @pysource-com  3 роки тому +1

      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

    • @ber2996
      @ber2996 3 роки тому +1

      @@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

    • @Tuncaydin0
      @Tuncaydin0 2 роки тому

      @@ber2996 did you solve

    • @ber2996
      @ber2996 2 роки тому

      @@Tuncaydin0 pc performance is the problem, have to get a better pc

    • @Tuncaydin0
      @Tuncaydin0 2 роки тому

      @@ber2996 thank you

  • @sltechgalaxy1677
    @sltechgalaxy1677 2 роки тому

    Hey excuse me sir please can we use Esp 32 camera module for this project??

  • @dmitrystasiukewicz3841
    @dmitrystasiukewicz3841 2 роки тому

    what algorithm was used to identify the face?

  • @JNET_Reloaded
    @JNET_Reloaded 3 роки тому

    How can i do this with an external ip camer on same network please? not built in web cam on an rpi4 or anything?

  • @aliashmawy425
    @aliashmawy425 Рік тому

    what is your pc specs, i tried the code on my laptop but it slows down when it detects a face

  • @a-tiku-r
    @a-tiku-r 7 місяців тому

    This is magnificent, Thanks for sharing!
    Currently i am working on a project in this related topic (Human Face Recognition).

  • @aliciahock9651
    @aliciahock9651 8 місяців тому

    I just tried this and it works perfectly! Thank you so much!

  • @bilgekaanozturk222
    @bilgekaanozturk222 9 місяців тому

    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

  • @Ickooo
    @Ickooo Рік тому +1

    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.

    • @VojtaGaming25
      @VojtaGaming25 Рік тому

      me too have you fixed it?

    • @Ickooo
      @Ickooo Рік тому

      ​@@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.

  • @youssefthebest1784
    @youssefthebest1784 2 роки тому

    Hello
    can you please help me
    I want an algorithme
    that tells me if two shapes are the same shape

  • @meltysensei2652
    @meltysensei2652 3 роки тому +3

    This is amazing and it works (python 3.7, pip installs), thank you!

  • @fadhelalsuwaidi1221
    @fadhelalsuwaidi1221 3 роки тому

    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.

  • @kaziranga_national_park
    @kaziranga_national_park 3 роки тому

    Sir, is possible ?. Photo-recognition software catches tigers by their stripes. Already given name to tiger Id

  • @aryanexegamer8748
    @aryanexegamer8748 10 місяців тому

    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.

  • @mastersidea89
    @mastersidea89 Рік тому

    Initial i i saw as a good tutorial but why do you make it hard to get the simplefacerec file?

  • @ariramadhan3608
    @ariramadhan3608 Місяць тому

    how to overcome "RuntimeError: Unsupported image type, must be 8bit gray or RGB image" , even though I have downloaded the file you shared😔

  • @gugupcoutinho
    @gugupcoutinho 2 роки тому

    14:36 if you get an error rey another value for VideoCapture( )
    I tried with VideoCapture(0) and it worked

  • @chitrakaseri5203
    @chitrakaseri5203 Рік тому

    Where do we get that Simple_facerec python file from????

  • @Kaijoh
    @Kaijoh 2 роки тому

    please help idk why i cant install face_recognition and also dlib :'(

  • @mahmudaromarahman5528
    @mahmudaromarahman5528 3 роки тому

    Dear Mr. Sergio, which algorithm has been used here? Mention, please.

  • @nusratjui7359
    @nusratjui7359 3 роки тому +1

    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?😰😰

  • @usmanhassan1170
    @usmanhassan1170 3 роки тому +3

    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.

    • @pysource-com
      @pysource-com  3 роки тому +1

      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.

    • @usmanhassan1170
      @usmanhassan1170 3 роки тому +1

      @@pysource-com okay, i see, btw you are doing great work.

  • @godphoenix1916
    @godphoenix1916 3 роки тому

    how can we add an excel sheet in it so that we can keep the track of people that were scanned

  • @zaidomar3402
    @zaidomar3402 3 роки тому

    I got this probelm operands could not be broadcast together with shapes *(1,16)(128,)*
    any idea or video that helps. thanks

  • @zijinzhang20
    @zijinzhang20 3 роки тому

    does the library accept multiple samples of one face?

  • @danishhussain4816
    @danishhussain4816 2 роки тому

    my web cam live-video is freezing. its reaction time is very low, what should i do?

  • @litunmeher9588
    @litunmeher9588 2 роки тому

    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?

  • @zarafshanbibi2035
    @zarafshanbibi2035 3 роки тому +2

    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?

    • @saaidalkamha7240
      @saaidalkamha7240 3 роки тому

      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

    • @Ankitkumar-kk5rm
      @Ankitkumar-kk5rm 2 роки тому

      have you made your project by now? @zarafshan Bibi

  • @Motivatorjoshua
    @Motivatorjoshua 2 роки тому

    Pls, how about object recognition? I have a project I'm working on object recognition. Kindly help out

  • @buluecolour3190
    @buluecolour3190 2 роки тому

    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

  • @udaykiran5602
    @udaykiran5602 2 роки тому +1

    Bro help me to how to download the face recognition and simple facereck files

  • @ryoo5295
    @ryoo5295 2 роки тому

    Is there a score that describe similarity between the images

  • @JohnnyDangerously1776
    @JohnnyDangerously1776 Рік тому

    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?

  • @nguyenhuydinh
    @nguyenhuydinh 3 роки тому

    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 ... ?

    • @pysource-com
      @pysource-com  3 роки тому

      exactly, you need to write the code in order that stores new encoding faces dinamically once a new face is detected

  • @sharvariwalde8116
    @sharvariwalde8116 2 роки тому

    i have lots of errors installing dlib library , it's unable to install, what should i do?👏

  • @anshulmaheshwari2408
    @anshulmaheshwari2408 2 роки тому

    how do i save detections using imwrite function to a folder

  • @lesptitsoiseaux
    @lesptitsoiseaux Рік тому

    How do you use the gpu do do this?

  • @atharvagosavi7771
    @atharvagosavi7771 3 роки тому

    The Rectangle frame is not getting created it throws error at simple_facerec.py file, what should I do????

  • @amishah4145
    @amishah4145 Рік тому

    can you name the tech stacks used?

  • @holo388
    @holo388 Рік тому

    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 ??

  • @muhdsafie805
    @muhdsafie805 3 роки тому +1

    Hi, i have problem with the fps. Mine not smooth as in your vid.

  • @leilaghasemzade5880
    @leilaghasemzade5880 2 роки тому

    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?

  • @johnmarctamera247
    @johnmarctamera247 2 роки тому

    why is it when I type pip install opencv, it tells me its not recognized?

  • @nbsu766
    @nbsu766 2 роки тому

    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?

  • @fathimafaziya3778
    @fathimafaziya3778 Рік тому

    can i know what does simple face file contain ?

  • @kavyan3731
    @kavyan3731 Рік тому

    Amazing tutorial! Worked perfectly! thanks!

  • @SahdeuAriel
    @SahdeuAriel 5 місяців тому

    which sofware are you using'

  • @trick_bros
    @trick_bros 2 роки тому

    What is the algorithm name plz

  • @muhammadilham248
    @muhammadilham248 2 роки тому

    Could anyone advise, I got it running but it seems like when it detects a face the webcam seems to be so laggy

  • @_sethiudit_
    @_sethiudit_ 10 місяців тому

    Does this detect multiple face on same time....

  • @ahmed1o137
    @ahmed1o137 3 роки тому +1

    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

    • @Mooseynair
      @Mooseynair 2 роки тому +1

      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

    • @ahmed1o137
      @ahmed1o137 2 роки тому

      @@Mooseynair thanks for the help 👍

  • @rizmyabdulla
    @rizmyabdulla 2 роки тому

    Very Helpful Video For Me, Thanks

  • @Redroseeditz
    @Redroseeditz Місяць тому

    RuntimeError: Unsupported image type, must be 8bit gray or RGB image.

  • @hakunamatata1035
    @hakunamatata1035 Рік тому

    Is this also able to detect side faces

  • @MRmidnightify
    @MRmidnightify Рік тому

    i cant find module simple_facerec, how to download it

  • @rheaynah
    @rheaynah 2 роки тому

    what algorithm did you use?

    • @pysource-com
      @pysource-com  2 роки тому

      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

  • @pankajbehera5035
    @pankajbehera5035 3 роки тому

    Cv2.imshow("Frame",frame)
    Indentation error: doesn't match any outer identification level

  • @v1hana350
    @v1hana350 2 роки тому +1

    How did you calculate accuracy and loss functions by using the face recognition library?

    • @lolgamer8591
      @lolgamer8591 2 роки тому +1

      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

    • @mohammedazzan7529
      @mohammedazzan7529 2 роки тому

      @@lolgamer8591 did u get thr solution?

  • @TheYapix
    @TheYapix 3 роки тому

    i got errror invalid syntax in img_encoding = face_recognition.face_encodings(rgb_img) [0] why master?

  • @christiannsue259
    @christiannsue259 10 місяців тому

    Hi where can i find the simple_facerec file?

  • @abdulrehmananwar6990
    @abdulrehmananwar6990 2 роки тому

    is there anyway to just recognize only live face not from picture.

  • @Pastelfrog3569
    @Pastelfrog3569 2 роки тому

    @Pysource we have a problem at line 5