Real-Time Face Recognition with Python and OpenCV - A Step-by-Step Guide 🚀

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 102

  • @apycoder
    @apycoder  6 дней назад

    Check out our face recognition Based attendance system ruclips.net/video/F8Q3TrVc43Y/видео.html

  • @ShazVilliers
    @ShazVilliers Год назад +4

    Great work. Gonna help lots of people including me👏

  • @user-cy7pj7yu9c
    @user-cy7pj7yu9c 3 месяца назад +2

    Which dlib and face recognition version u have used in this code ?

  • @awadijohan
    @awadijohan 7 месяцев назад

    great video thanks you saved my journey, appreciate help and thanks from bottom heart

  • @prathameshshinde7
    @prathameshshinde7 3 месяца назад

    Thank you very very much sir for this video. Hope you prosper a lot in your life❤❤❤❤❤

  • @Junior-fq8jo
    @Junior-fq8jo 9 месяцев назад +1

    Salut et super travaille j'essai de faire le même depuis mais un message d'erreur s'affiche disant module cv2 not found donc j'ai passé des heures sur RUclips pour parvenir à le réparer mais sans succès en utilisant pip install opencv-python mais sans succès slt tu peux m'aider ?

  • @rifat4330
    @rifat4330 Год назад +2

    Nice one bro❤
    .
    .
    .
    I need e face recognition tutorial with YOLO algorithm.

    • @apycoder
      @apycoder  Год назад +1

      Ok yolo tutorial will come soon 🥰

  • @41_BenjaminGeorgeVarghese
    @41_BenjaminGeorgeVarghese 5 месяцев назад +2

    i am not able to install face_recognition it is asking for dlib and when i try to install dlib it is asking for cmake and even after installing cmake dlib is not getting installed and so is face_recognition

    • @apycoder
      @apycoder  5 месяцев назад

      Unfortunately, most face recognition libraries don't officially support Windows. However, you can try this complete face recognition project that doesn't require a face recognition library: Real-time Face Recognition System using Python & OpenCV. It should work well for you!
      apycoder.com/product/real-time-face-recognition-system-using-python-opencv/

    • @41_BenjaminGeorgeVarghese
      @41_BenjaminGeorgeVarghese 5 месяцев назад

      @@apycoder I somehow made it work but sometimes it is predicting wrong is it because of less entries in the dataset?

  • @dilmithwathsala
    @dilmithwathsala 3 месяца назад

    Nice work. Thank you

  • @_AYANROY
    @_AYANROY Год назад +6

    face recognition is not installing. can you help please ?

    • @kexanatoronto6896
      @kexanatoronto6896 Год назад +1

      Send your error code

    • @annmariyajoy6293
      @annmariyajoy6293 11 месяцев назад

      I also got the same error

    • @apycoder
      @apycoder  11 месяцев назад

      Check face recognition library documentation. Is it compatible with your operating systems or not

    • @nikkiverse3070
      @nikkiverse3070 10 месяцев назад

      @@apycoder
      IndentationError: unindent does not match any outer indentation level
      Help me

    • @yoBoi.007
      @yoBoi.007 2 месяца назад

      @@nikkiverse3070 its only identation error nothing difficult only you can change line of spaces where it showing error

  • @nesrinkalkan2339
    @nesrinkalkan2339 6 месяцев назад +4

    Exception has occurred: RuntimeError
    Unsupported image type, must be 8bit gray or RGB image.
    File "C:\Users\ASUS\Desktop\bitirme\.ipynb_checkpoints\import face_recognition.py", line 13, in
    face_encodings = face_recognition.face_encodings(rgb_image)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
    bu hatayı alıyorum lütfen yardımcı olurmusunuz

    • @vladyslav-py-js-go
      @vladyslav-py-js-go 6 месяцев назад +2

      I just uninstalled numpy 2.x.x, and then installed older version 1.26.4 (pip install numpy==1.26.4)

    • @rajkireetimaddala7042
      @rajkireetimaddala7042 4 месяца назад +1

      @@vladyslav-py-js-go Thank you bro

  • @forwardtechnical
    @forwardtechnical 11 месяцев назад +1

    Great video, can you make the same thing using CNN model please !!

  • @hafsathkk8236
    @hafsathkk8236 6 месяцев назад +1

    Thanks bro it's work's

  • @sahilgamer4081
    @sahilgamer4081 Год назад +2

    Supb.. Bro..... ❤

  • @himaanshuGurjar
    @himaanshuGurjar 2 месяца назад

    Which ide you are using

  • @yasiazizi2930
    @yasiazizi2930 13 дней назад

    Hi.
    Can you also teach how to recognize faces with masks? Or do you know the source code for it that you can give me :)

  • @kdt85
    @kdt85 Месяц назад

    Thanks!

  • @ojamyjack4248
    @ojamyjack4248 10 месяцев назад +1

    how do i get the face_recognition module

    • @apycoder
      @apycoder  9 месяцев назад

      pip install face_recognition
      pip install opencv-python
      If you don't have Python installed, download and install it from the official Python website:

  • @mohithk1654
    @mohithk1654 15 дней назад

    I had buy your code but it is not working like face recognition library. It detect only as it is pictures, Please suggest what to do and it is error in import torch what i should do can u help me out

    • @apycoder
      @apycoder  15 дней назад

      You can message me on Whatsapp app I will fix this bug

    • @apycoder
      @apycoder  15 дней назад

      I have fixed this bug , you can download it again, there is no limit to download.

    • @mohithk1654
      @mohithk1654 15 дней назад

      @ number

    • @mohithk1654
      @mohithk1654 15 дней назад

      @@apycoder sir it is asking to pay

    • @mohithk1654
      @mohithk1654 15 дней назад

      sorry to distrub you sir how can i download it again sir

  • @RoshiniChuri
    @RoshiniChuri 5 месяцев назад

    Which is the front end and back end ?

  • @syaabanbux7516
    @syaabanbux7516 7 месяцев назад +1

    Yo bro, i have a favor to ask, how can i use face recorgnition to recognize face image that were stored in the database. If the face image is same as the image that were captured by the frame then it will display my name, can u show me how to do that, sorry if my english is bad

    • @Atlantic025
      @Atlantic025 6 месяцев назад

      did u figure it out how?

    • @apycoder
      @apycoder  5 месяцев назад

      ​@@Atlantic025 yes brother you can get code for this , just msg me on WhatsApp

  • @trainzworldgaming4935
    @trainzworldgaming4935 5 месяцев назад

    Bro should i declare path instead of file name?

  • @Deadsoul098
    @Deadsoul098 11 месяцев назад

    Assalamualaikum fase recingization ky liy konsi app use kr rhy ha ?ya ap kis pa work kr rhy ha plz tell me?

    • @apycoder
      @apycoder  10 месяцев назад

      Linux OS and visual studio code for this project

  • @awabibrahimmohamedahmed6464
    @awabibrahimmohamedahmed6464 9 месяцев назад

    bro what is the type of the app that you are working at??

    • @apycoder
      @apycoder  9 месяцев назад

      I am using Kali Linux OS , and visual studio code for development

    • @awabibrahimmohamedahmed6464
      @awabibrahimmohamedahmed6464 9 месяцев назад

      the camera never shows up
      @@apycoder

    • @rishigujarathi7146
      @rishigujarathi7146 6 месяцев назад

      ​@@apycoder it can run on windows or not?

    • @apycoder
      @apycoder  6 месяцев назад

      Officially the face recognition library doesn't support windows. So it won't run

  • @RuturajPatil-x1l
    @RuturajPatil-x1l 4 месяца назад

    Bro how can run on gup rather than cpu

  • @user-cy7pj7yu9c
    @user-cy7pj7yu9c 3 месяца назад

    Failed building wheel for dlib , failed to build installable wheels for some pyproject.toml based projects (dlib) how to solve this error..plz explain in easy way

    • @SambaOtieno
      @SambaOtieno 3 месяца назад

      for these error you will have to install cmaker in your device so that the pkg can be compilled inorder to be runned

  • @ManojKumar-go1pm
    @ManojKumar-go1pm 10 месяцев назад

    Can you make vdo on ,how to connect template in django

  • @PoonamPatil-u8y
    @PoonamPatil-u8y 4 месяца назад

    I had buy your code but it is not working like face recognition library. It detect only as it is pictures, Please suggest what to do

    • @apycoder
      @apycoder  4 месяца назад

      Please what's app me , I will help you in installation

  • @rajkireetimaddala7042
    @rajkireetimaddala7042 4 месяца назад

    Thank you sir

  • @himaanshuGurjar
    @himaanshuGurjar 2 месяца назад

    How to do python coding in kali linux

  • @Aaa90099
    @Aaa90099 9 месяцев назад

    Can I use raspberry pi through ssh and do this? If yes how?

    • @apycoder
      @apycoder  9 месяцев назад

      Yes, you can use a Raspberry Pi for a face recognition project via SSH. You'll need to set up the necessary software and libraries on your Raspberry Pi, and then you can access and control it remotely using SSH. Make sure your Raspberry Pi has a camera module or a compatible USB camera for capturing images for face recognition.

  • @Momsmagic82
    @Momsmagic82 5 месяцев назад

    Bro please help your code did't work there is an error show and submission date is 20 please help

    • @apycoder
      @apycoder  5 месяцев назад

      Send me code on WhatsApp, you can find my what's app no on my website

  • @PonrajanN
    @PonrajanN 4 месяца назад

    i have Some kind of bellow error any one plz help to clear the erroe ( self: _dlib_pybind11.fhog_object_detector, image: numpy.ndarray, upsample_num_times: int = 0) -> _dlib_pybind11.rectangles Invoked with: , None, 1)

  • @sithuaung2433
    @sithuaung2433 10 месяцев назад

    Please can you explain and code for object detection with live webcam Sir?Please Sir?

    • @apycoder
      @apycoder  10 месяцев назад

      Check my video there is specific for object detection, eye detection, blink counter, and driver drowsiness detection

  • @snehagupta4586
    @snehagupta4586 9 месяцев назад

    Name error : name 'known_person1_image' is not defined
    How to resolve this???

    • @apycoder
      @apycoder  9 месяцев назад

      If you are using window os then give the complete image path

    • @apycoder
      @apycoder  9 месяцев назад

      Send me code on WhatsApp

    • @devjai643
      @devjai643 9 месяцев назад

      Re-check the name there must be a typo in your code,
      Here is the working code:
      import cv2
      import face_recognition
      # Load known face encodings & names
      known_face_encodings = []
      known_face_names = []
      # Load known faces & their names
      known_person1_image = face_recognition.load_image_file("Photos/Dev.jpg")
      known_person2_image = face_recognition.load_image_file("Photos/Elon.jpg")
      known_person1_encoding = face_recognition.known_face_encodings(known_person1_image)[0]
      known_person2_encoding = face_recognition.known_face_encodings(known_person2_image)[0]
      known_face_encodings.append(known_person1_encoding)
      known_face_encodings.append(known_person2_encoding)
      known_face_name.append("Dev")
      known_face_name.append("Elon")
      # Initialize the webcam
      video_capture = cv2.VideoCapture(0)
      while True:
      # Capture frame by frame
      ret, frame = video_capture.read()
      # Find all face location in the current frame
      face_locations = face_recognition.face_location(frame)
      face_encodings = face_recognition.face_encoding(frame, face_location)
      # Loop through each frame found in the frame
      for (top, right, bottom, left), face_encoding in zip(face_location, face_encodings):
      # Check if face matches any known faces
      matches = face_recognition.compare_faces(known_face_encodings, face_encoding)
      name = "Unknown"
      if True in matches:
      first_match_index = matches.index(True)
      name = known_face_names[first_match_index]
      #Draw a box around the box & label the face_encoding
      cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
      cv2.putText(frame, name, (left, top - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 0, 255), 2)
      # Display the resulting frame
      cv2.imshow("Video", frame)
      if cv2.waitKey(1) & 0xFF == ord('q'):
      break
      # Release the webcam and close OpenCV
      video_capture.release()
      cv2.destroyAllWindows()

    • @devjai643
      @devjai643 9 месяцев назад

      Try this:
      import cv2
      import face_recognition
      # Load known face encodings & names
      known_face_encodings = []
      known_face_names = []
      # Load known faces & their names
      known_person1_image = face_recognition.load_image_file("Photos/Dev.jpg")
      known_person2_image = face_recognition.load_image_file("Photos/Elon.jpg")
      known_person1_encoding = face_recognition.face_encodings(known_person1_image)[0]
      known_person2_encoding = face_recognition.face_encodings(known_person2_image)[0]
      known_face_encodings.append(known_person1_encoding)
      known_face_encodings.append(known_person2_encoding)
      known_face_names.append("Dev")
      known_face_names.append("Elon")
      # Initialize the webcam
      video_capture = cv2.VideoCapture(0)
      while True:
      # Capture frame by frame
      ret, frame = video_capture.read()
      # Find all face location in the current frame
      face_locations = face_recognition.face_locations(frame)
      face_encodings = face_recognition.face_encodings(frame, face_locations)
      # Loop through each frame found in the frame
      for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
      # Check if face matches any known faces
      matches = face_recognition.compare_faces(known_face_encodings, face_encoding)
      name = "Unknown"
      if True in matches:
      first_match_index = matches.index(True)
      name = known_face_names[first_match_index]
      #Draw a box around the box & label the face_encoding
      cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
      cv2.putText(frame, name, (left, top - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 0, 255), 2)
      # Display the resulting frame
      cv2.imshow("Video", frame)
      if cv2.waitKey(1) & 0xFF == ord('q'):
      break
      # Release the webcam and close OpenCV
      video_capture.release()
      cv2.destroyAllWindows()

    • @snehagupta4586
      @snehagupta4586 8 месяцев назад

      I am getting name error in code how to correct this?

  • @Kamatchi-d3h
    @Kamatchi-d3h 10 месяцев назад

    how to install face recognition for python 3.12?

    • @apycoder
      @apycoder  10 месяцев назад

      Join our WhatsApp group

  • @dpssouth-s2t
    @dpssouth-s2t 4 месяца назад

    i love robin duttha

  • @amanisguru6114
    @amanisguru6114 10 месяцев назад

    Isme attendance kaise laga sakte hai

    • @apycoder
      @apycoder  10 месяцев назад

      There is a separate video for face recognition based attendance system

    • @amanisguru6114
      @amanisguru6114 10 месяцев назад

      @@apycoder watched it already

  • @gungungupta162
    @gungungupta162 6 месяцев назад

    pura code likha but its showing error : no such file or directory

    • @UmeshBhandari-f9b
      @UmeshBhandari-f9b 6 месяцев назад

      8 hour hogaya error solve nahi horaha dimak ka dahi hogaya😒😒

    • @apycoder
      @apycoder  6 месяцев назад

      Share code on WhatsApp I Will check and let you know what's the problem is

    • @apycoder
      @apycoder  6 месяцев назад

      Keep all the images in the same working directory

    • @apycoder
      @apycoder  6 месяцев назад

      This error occurred when python code is unable to find your images path, make sure to keep all the images in the same working directory

    • @UmeshBhandari-f9b
      @UmeshBhandari-f9b 6 месяцев назад

      @@apycoder whatappps no. ?

  • @tahmidrahman8173
    @tahmidrahman8173 Год назад +1

    is it based on CNN?

    • @apycoder
      @apycoder  Год назад

      Yes python face recognition library is based on CNN

    • @sujoysetua0814
      @sujoysetua0814 Год назад

      ​​@@apycodervai please give the source code

    • @apycoder
      @apycoder  Год назад

      Go and visit again to get Source code , i have added link in the description

  • @dpssouth-s2t
    @dpssouth-s2t 4 месяца назад

    i love robbin dutha

  • @user-qo5fb7uv4j
    @user-qo5fb7uv4j 10 месяцев назад

    bhai 50 Line ke code ke liye 300rs mang rha hai itna to cahtgpt likh ke de denga
    by the wat i like this video

  • @SatyaYinakonda
    @SatyaYinakonda 10 месяцев назад

    Identation problem at unknown

    • @apycoder
      @apycoder  10 месяцев назад

      Join our WhatsApp group and send me your code

  • @himanshumatlani8587
    @himanshumatlani8587 3 месяца назад

    reply me for issues in installing face recognition i will help u out

  • @lavanreddy2408
    @lavanreddy2408 9 месяцев назад

    Bro can you send source code

    • @apycoder
      @apycoder  9 месяцев назад

      There is a source code link in the description

    • @devjai643
      @devjai643 9 месяцев назад

      import cv2
      import face_recognition
      # Load known face encodings & names
      known_face_encodings = []
      known_face_names = []
      # Load known faces & their names
      known_person1_image = face_recognition.load_image_file("Photos/Dev.jpg")
      known_person2_image = face_recognition.load_image_file("Photos/Elon.jpg")
      known_person1_encoding = face_recognition.face_encodings(known_person1_image)[0]
      known_person2_encoding = face_recognition.face_encodings(known_person2_image)[0]
      known_face_encodings.append(known_person1_encoding)
      known_face_encodings.append(known_person2_encoding)
      known_face_names.append("Dev")
      known_face_names.append("Elon")
      # Initialize the webcam
      video_capture = cv2.VideoCapture(0)
      while True:
      # Capture frame by frame
      ret, frame = video_capture.read()
      # Find all face location in the current frame
      face_locations = face_recognition.face_locations(frame)
      face_encodings = face_recognition.face_encodings(frame, face_locations)
      # Loop through each frame found in the frame
      for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
      # Check if face matches any known faces
      matches = face_recognition.compare_faces(known_face_encodings, face_encoding)
      name = "Unknown"
      if True in matches:
      first_match_index = matches.index(True)
      name = known_face_names[first_match_index]
      #Draw a box around the box & label the face_encoding
      cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
      cv2.putText(frame, name, (left, top - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 0, 255), 2)
      # Display the resulting frame
      cv2.imshow("Video", frame)
      if cv2.waitKey(1) & 0xFF == ord('q'):
      break
      # Release the webcam and close OpenCV
      video_capture.release()
      cv2.destroyAllWindows()