Face recognition in real-time | with Opencv and Python

Поділитися
Вставка
  • Опубліковано 28 лис 2024

КОМЕНТАРІ •

  • @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 роки тому +15

    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 Місяць тому

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

  • @cgoody3170
    @cgoody3170 Рік тому +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.

  • @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 5 місяців тому +1

      You could make the recognition only run on frame modulo 30

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

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

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

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

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

  • @vianayyasmin
    @vianayyasmin Місяць тому +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?

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

    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

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

    Sir what's the use of simple facerec file ?

  • @erickruhcardozo
    @erickruhcardozo 2 місяці тому +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...

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

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

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

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

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

    Gives an error while importing SimpleFacerec module, any solutions?

    • @rosé-f2w1r
      @rosé-f2w1r 11 місяців тому +1

      Did you find the solution?

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

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

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

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

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

    where is the link for simple_facerec?????

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

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

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

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

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

    which algorithm is used in this project????

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

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

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

  • @henkhbit5748
    @henkhbit5748 2 роки тому +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.

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

    where are the files as u said they are in description

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

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

    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 3 місяці тому +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

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

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

  • @Redroseeditz
    @Redroseeditz 19 днів тому

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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.

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

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

    from where do i download those 2 py files?

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

    'pip' is not recognized as an internal or external command,
    operable program or batch file.

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

    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?

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

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

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

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

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

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

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

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

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

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

    is this viola jones algorithm??
    please for educational purpose

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

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

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

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

    The simple face rec module isn't working on my laptop it can't even be found is there a solution pls I need help

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

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

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

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

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

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

    what algorithm was used to identify the face?

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

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

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

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

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

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

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

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

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

    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

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

    i cant download open cv face recognition module and i cant install dlib and c make i get an error

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

    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?

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

      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)

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

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

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

    can i know what does simple face file contain ?

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

    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

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

    I am stuck with this error:
    ValueError: attempt to get argmin of an empty sequence

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

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

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

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

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

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

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

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

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

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

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

    how can I add like if it see this face print Hello or else

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

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

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

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

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

    Thanks for sharing..when I add Arabic text instead of English I get question marks ?? What should I fix to display it properly ?

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

      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

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

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

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

    What is the algorithm name plz

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

    @Pysource we have a problem at line 5

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

  • @BongFoodyAdventures
    @BongFoodyAdventures 3 місяці тому

    i am facing error in dlib while "pip install face_recognition": Failed to build dlib.. pls help

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

    hai for source code i already register but why I still cant download your code and I always need register

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

    i cant find module simple_facerec, how to download it

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

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

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

    how do i save detections using imwrite function to a folder

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

    Is there a score that describe similarity between the images

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

    how ı do confidence score this project? please can you share code if you have this..

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

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

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

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

    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

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

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

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

    can you name the tech stacks used?

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