Facial Recognition with Python and the face_recognition library

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 484

  • @TheSaintsVEVO
    @TheSaintsVEVO 4 ปีที่แล้ว +256

    All I’ll say is... no one has seen him and Snowden in the same room at the same time.

  • @AccessCode101
    @AccessCode101 4 ปีที่แล้ว +139

    HE'S BACK! OH MY GOD, BUCKY IS BACK!!!!!!!!!!!!!!!!!

    • @sentdex
      @sentdex  4 ปีที่แล้ว +24

      For a sec I thought maybe bucky was back. Sad.

    • @AccessCode101
      @AccessCode101 4 ปีที่แล้ว

      @@sentdex At least on my feed. I hadn't seen you for a while, altjought I'm a subscriber. Guess it's TH-cam's algorithm

    • @damilareemmanuel
      @damilareemmanuel 4 ปีที่แล้ว +2

      lmao, I actually thought Bucky was back.

    • @sentdex
      @sentdex  4 ปีที่แล้ว +8

      @@AccessCode101 but you know I'm not Bucky right

    • @vebexplaeya
      @vebexplaeya 4 ปีที่แล้ว +4

      We miss Buck 😢

  • @damienw4958
    @damienw4958 4 ปีที่แล้ว +20

    9:40 the reason you might not want to use f strings is because the os method is os independent. Not usually an issue, but your code is just slightly more robust using os.

    • @NathanielMitchellnm
      @NathanielMitchellnm 4 ปีที่แล้ว

      Someone beat me to the response. I was going to say exactly the same thing as Damien.

    • @aHardReset
      @aHardReset 4 ปีที่แล้ว +1

      Yep, for example Windows uses the '\' for join paths

  • @siddharameshkmudhol8770
    @siddharameshkmudhol8770 4 ปีที่แล้ว +6

    Cool! I never expected python to be so powerful:D

  • @RameenFallschirmjager
    @RameenFallschirmjager 4 ปีที่แล้ว +5

    It's been a while. Actually today I was thinking about you and where you might be this long! I'm glad to see you again.

  • @vishcorpgames9471
    @vishcorpgames9471 4 ปีที่แล้ว

    You're like THE best programming channel on TH-cam! Seriously like THANK YOU FOR EXISTING!

  • @John-xi2im
    @John-xi2im 8 หลายเดือนก่อน

    while executing "encoding = face_recognition.api.face_encodings(image)[0] " line of code, IndexError: list index out of range occurs. That means that face was not recognized by the face_recognition package!! Thanks Sentdex ! Very awesome tutorials! Learning style is simply awesome 😃

  • @laupetre
    @laupetre 4 ปีที่แล้ว +2

    This is awesome! Please continue this series!

  • @gwhocodes2433
    @gwhocodes2433 3 ปีที่แล้ว

    Just 4 minutes in, I thought I was on a tech tutorial turns out it's a nice comedy lol
    I love your humour !!

  • @ValerioVelardoTheSoundofAI
    @ValerioVelardoTheSoundofAI 4 ปีที่แล้ว +2

    It's great to see you're back!

  • @umutozsoy19
    @umutozsoy19 4 ปีที่แล้ว +1

    I was just writing a paper about this lib for my graduation great help + timing thx

  • @alpeshvasani8626
    @alpeshvasani8626 4 ปีที่แล้ว +1

    Thank you Bucky! Good to see you. You are always the reason for happiness. :)

    • @sentdex
      @sentdex  4 ปีที่แล้ว +1

      Ok but you know I'm not *really* bucky right?

  • @AlienAndrew51
    @AlienAndrew51 4 ปีที่แล้ว +41

    Combine this with beautiful soup or selenium and you have built the same technology that scrapes suspect faces from social media. The use of libraries and API's have made it so easy to use artificial intelligence.

    • @sysadmin9396
      @sysadmin9396 4 ปีที่แล้ว +1

      Andrew James does beautiful soup and selenium allow you to download all public data? Let’s say a radius that has 250k ppl? I was looking into this and read that clearview AI is getting sewed for it.. still want to do this on my own tho! I believe Facebooks graph API only allows you to get data from your own profile:/

    • @AlienAndrew51
      @AlienAndrew51 4 ปีที่แล้ว +2

      @@sysadmin9396 It's possible you can do this by scrapping the data with selenium, puppeteer (JavaScript), and beautiful soup. You just need accounts for the Social Media to log in. There are a lot of videos online on how to approach web scrapping :) and happy hacking!

    • @sysadmin9396
      @sysadmin9396 4 ปีที่แล้ว +1

      Andrew James thank you! Appreciate the response ! I’m currently getting the code together for the facial recognition part.. doing some shopping around for glasses that have an IP addressable camera . All that mixed with the scrapping and I might have myself some cool tech! Lol

    • @Killer-mx7tr
      @Killer-mx7tr 4 ปีที่แล้ว

      You just defined my senior project, will be releasing it soon on git, scarped all the pics from FB and IG and used LBPH along with CNN to find the nasty buggers via input from my drone camera. All that done in a clean Pyqt5 UI with threads ;)

    • @Sourabh5570
      @Sourabh5570 4 ปีที่แล้ว

      @@Killer-mx7tr I'd love to have a look, do update.

  • @diefmohamed1085
    @diefmohamed1085 4 ปีที่แล้ว

    It's great to see you're back.

  • @hassenzarroug9159
    @hassenzarroug9159 4 ปีที่แล้ว +3

    I am a huge fan of what you do! Thank you so much!
    I hope that one day you make a serie about transfer learning.

    • @sentdex
      @sentdex  4 ปีที่แล้ว +3

      I have a plan to cover it at some point. The main issue is it's a pretty general concept and it can vary depending on the task.

  • @SeucheAchat
    @SeucheAchat 4 ปีที่แล้ว

    You are such a great programming dude on youtube :) love to see there is a new video

  • @maikelvangorkom
    @maikelvangorkom 3 ปีที่แล้ว

    Thanks for the tutorial. Taken your script as a basefor my face recognition script. Main difference is that i don't display the image with a square around the face, but it moves it to another folder with the name of the person in front of it. THX again!

  • @coolguy7974
    @coolguy7974 4 ปีที่แล้ว +7

    Hello, great video! :D
    If anyone is having this error on Windows 10:
    NotADirectoryError: [WinError 267] The directory name is invalid: 'known_faces/9a7f3cd.png'. I got around this by using
    for filename in os.path.join(KNOWN_FACES_DIR, name):
    instead of
    for filename in os.listdir(f'{KNOWN_FACES_DIR}/{name}')
    This worked for me.
    Good luck.

    • @animeshyadav9317
      @animeshyadav9317 4 ปีที่แล้ว

      thanks

    • @mansimishra19
      @mansimishra19 4 ปีที่แล้ว +1

      How to load files then?
      Please tell the replaced command for this too
      image = face_recognition.load_image_file(f'{Known_Faces_Dir}/{name}/{filename})

  • @lqx7
    @lqx7 4 ปีที่แล้ว +3

    Literally watching this at 2.30 in the morning.

  • @kindergartenkindergarten8401
    @kindergartenkindergarten8401 4 ปีที่แล้ว

    Thank you so much. I am new in programming and trying to do this. It is great and very helpful.

  • @arielbalceda3075
    @arielbalceda3075 4 ปีที่แล้ว

    OMG! Un video de Sentdex un domingo por la tarde? 👏👏👏 Ya mismo a verlo!!!

  • @MiserableLemon
    @MiserableLemon 4 ปีที่แล้ว

    I love your tutorials so much, thanks!

  • @josephwong2832
    @josephwong2832 4 ปีที่แล้ว

    Sentdex you should try to get a sponsorship from kite as they have sponsored other youtubers and you just made the best advertisement overall imo.
    Also, you are edward snowdens doppleganger!!!

  • @gm4984
    @gm4984 4 ปีที่แล้ว +13

    4:27 "my life" I know that feel bro

  • @patloeber
    @patloeber 4 ปีที่แล้ว

    Nice Tutorial! Thank you :)

  • @Ms.Robot.
    @Ms.Robot. 4 ปีที่แล้ว

    A beautiful mind. Nice hair cut too. I can't wait for more!

  • @vulcan4608
    @vulcan4608 4 ปีที่แล้ว +20

    When is the "neural networks from scratch" series coming out? I am eagerly waiting for it. Really like your channel.

    • @MrSameerMalik1
      @MrSameerMalik1 4 ปีที่แล้ว

      I think it's a book .. there was a kickstarter

    • @redefine-your-system8255
      @redefine-your-system8255 4 ปีที่แล้ว

      its out check playlist

    • @vulcan4608
      @vulcan4608 4 ปีที่แล้ว

      @@redefine-your-system8255 Yeah I know, my comment is a month old

  • @BurnerAccount777
    @BurnerAccount777 4 ปีที่แล้ว +7

    That hamburger mug is...oh so beautiful.

  • @michaelhernandez1185
    @michaelhernandez1185 4 ปีที่แล้ว

    With a little more code you can save the known_faces numpy ndarry in something like an Excel file and the names in a file too so you aren't training the face recognition each time it runs, saves a lot of time.

  • @mahmoodfathy5975
    @mahmoodfathy5975 4 ปีที่แล้ว

    Bro where have you been?
    Glad to have you back finally, wohoo

    • @sentdex
      @sentdex  4 ปีที่แล้ว +2

      Working on neural networks from scratch book/series.

  • @rotatingdisk
    @rotatingdisk 4 ปีที่แล้ว +47

    I am so used to see you on the left downside corner, watching this makes me feel disoriented!

    • @sentdex
      @sentdex  4 ปีที่แล้ว +20

      Good, I wanna keep you on your toes!

    • @kamuridesu
      @kamuridesu 4 ปีที่แล้ว

      @Tomer Horowitz I think the video was released to only members first

    • @IngegneriaParametrica
      @IngegneriaParametrica 4 ปีที่แล้ว

      @sentdex
      I am glad that you are back but I don’t want to see your back 🤣

    • @franzweitkamp
      @franzweitkamp 4 ปีที่แล้ว +2

      @@sentdex If you put yourself in the top right, can you flip the image so that you look towards the rest of the screen and not away from it? :)

    • @ekrem_dincel
      @ekrem_dincel 4 ปีที่แล้ว +1

      @@franzweitkamp I agree

  • @moustafa_shomer
    @moustafa_shomer 4 ปีที่แล้ว +1

    Please make another one on videos , that's so helpful

  • @beingraja9586
    @beingraja9586 4 ปีที่แล้ว

    Finally sir you are back

  • @mohammedalhabib4446
    @mohammedalhabib4446 4 ปีที่แล้ว +2

    Awesome, could you please make a video about activity recognition in videos, it will be a great help for most of your fans.

  • @jesusdpaz
    @jesusdpaz 4 ปีที่แล้ว +3

    Amazing thank you sir! Doing the same with video would be amazing!!!!

  • @jasonproconsult9525
    @jasonproconsult9525 4 ปีที่แล้ว

    Finally got face recognition working on GPU. I think its worth mentioning to include Visual C++ Tools in the Visual Studio 2015 installation. Unlike TensorFlow GPU, face recognition needs them otherwise dlib installation will not use CUDA.

  • @nem0287
    @nem0287 4 ปีที่แล้ว +6

    Nobody:
    Sentdex's door: *Knock~knock~bam
    FBI (barge in) : Snowden! You are under arrest!

  • @richard_wenner
    @richard_wenner 4 ปีที่แล้ว

    Video recognition would be good to see, if you have time. Thanks for all of your terrific efforts here.

  • @jabrane1564
    @jabrane1564 4 ปีที่แล้ว

    Please do the video one.
    This was so helpful.
    Thank you.

  • @harishvemula6709
    @harishvemula6709 4 ปีที่แล้ว

    This guy is my favourite 💯💯

  • @ssd431
    @ssd431 4 ปีที่แล้ว

    I am a fan. And you are the best.

    • @P3C0L4
      @P3C0L4 4 ปีที่แล้ว

      maybe you will evolve into air conditioner later 😁

  • @vedangpingle1914
    @vedangpingle1914 4 ปีที่แล้ว +1

    Hi, did you use CUDA in this script? Or was this running on your CPU alone? I am running the face_recognition package with dlib on Windows and it's pretty damn slow.

  • @palaashatri
    @palaashatri 4 ปีที่แล้ว +7

    Shows 'IndexError : list index out of range' at the following line : encoding = face_recognition.face_encodings(image)[0]

    • @raghavagarwal633
      @raghavagarwal633 4 ปีที่แล้ว

      Any solution for this error?

    • @abhilashkp6864
      @abhilashkp6864 4 ปีที่แล้ว +3

      this happens because there are no images detected to encode, hence the array is empty and cant have a 0th position. This maybe due to bad pose/quality of image or something wrong with the model. A solution would be the following :
      temp_encoding = face_recognition.face_encodings(image)
      if len(temp_encoding) > 0 :
      encoding = temp_encoding[0]
      else:
      print("no face found")
      quit()

  • @Franchyze923
    @Franchyze923 4 ปีที่แล้ว

    I found my next project! This looks sweet

  • @neomurali20
    @neomurali20 4 ปีที่แล้ว

    Ur videos r awesome. Thank u so much. U r really cool, when coding 😁

  • @statwizard
    @statwizard 4 ปีที่แล้ว

    Great video tutorial. "I think we have survived" Lol Lol 😂😂 Well done.

  • @EshwarNorthEast
    @EshwarNorthEast 4 ปีที่แล้ว

    Welcome back legend 😍

  • @keshavgupta8539
    @keshavgupta8539 4 ปีที่แล้ว +1

    If you are getting IndexError in encoding try this,
    location = face_recognition.face_locations(image, number_of_times_to_upsample=2, model='cnn')
    encoding = face_recognition.face_encodings(image, known_face_locations=location)[0]

  • @xali2008
    @xali2008 4 ปีที่แล้ว

    this library is good for face detection, for face recognition better use something like Facenet (you can find couple TensorFlow Keras implementation of Facenet)

  • @robertpietraru1939
    @robertpietraru1939 4 ปีที่แล้ว +2

    Python facial recognition: around 50 lines
    C/cpp/c sharp calculator: 100 lines

    • @gabrielceolato2
      @gabrielceolato2 4 ปีที่แล้ว

      You do realize a package is a group of modules, a module is a group of function, so without those packages the code would be like 2439834 lines

    • @robertpietraru1939
      @robertpietraru1939 4 ปีที่แล้ว +1

      @@gabrielceolato2 that's the point. There are so many things already done

  • @busterdafydd3096
    @busterdafydd3096 3 ปีที่แล้ว

    9:48 f strings are good I'm suprised they aren't used as much in python scripts that I have read. there are people who still use % notation in strings.

  • @abhaythakur8572
    @abhaythakur8572 4 ปีที่แล้ว

    Nice tutorial buddy

  • @viniciusrocha8306
    @viniciusrocha8306 4 ปีที่แล้ว

    Please do the video example, ur videos are great! Keep it up

  • @carloscerritoslira328
    @carloscerritoslira328 4 ปีที่แล้ว

    Great tutorial buddy

    • @sentdex
      @sentdex  4 ปีที่แล้ว

      Glad you liked it

  • @mbbxx
    @mbbxx 4 ปีที่แล้ว

    FYI: Kite has a history of acquiring Python libraries (One of them is autocomplete-python), then modified them to show ads and added telemetry. So they can basically intercept your code.

    • @sentdex
      @sentdex  4 ปีที่แล้ว

      They tried that as a business model long ago and it didnt go well for them. They've addressed that history on their blog if you want to learn more.

    • @mbbxx
      @mbbxx 4 ปีที่แล้ว

      @@sentdex Yes they posted a 'non-apology' apology on their blog. The question that everyone needs to decide themselves is, have they really learned and are they now trustworthy?

  • @gaboskyy1
    @gaboskyy1 4 ปีที่แล้ว

    Nice content again, am gonna order the book, I trust your contents any time

  • @rog0079
    @rog0079 4 ปีที่แล้ว

    heyyy, sentdex i was just curious, can u make videos on unsupervised deep learning techniques, like auto encoders (although it is self-supervised), GANs etc, it would be really helpful :'), Glad you're back.

  • @mahimanzum
    @mahimanzum 4 ปีที่แล้ว

    and he is back

  • @prasadgk2667
    @prasadgk2667 4 ปีที่แล้ว +3

    When running the code I came across error on the below line:
    encoding = face_recognition.face_encodings(image)[0]
    saying that:
    IndexError: list index out of range
    Removed [0] and it ran.
    but after print("Processing unknown faces")
    the system hangs and doesn't work

    • @martinsepulveda59
      @martinsepulveda59 4 ปีที่แล้ว

      I got the same error on pictures that is not able get a face recognition (from hog), it mean the numpy array for encoding is empty. In my case was the faces in more than 45° degrees of inclination.

    • @Gouled99
      @Gouled99 4 ปีที่แล้ว

      @@martinsepulveda59 how'd you fix it ?

    • @urzdvd
      @urzdvd 4 ปีที่แล้ว +1

      @@Gouled99 I had the same problem, just crop the photo to see the face more clear and without angle, use a normal selfie focusing in the face.

    • @figgi_myestrio5092
      @figgi_myestrio5092 4 ปีที่แล้ว

      @@urzdvd thank so much

  • @vishalrajput9856
    @vishalrajput9856 4 ปีที่แล้ว +1

    Our Snowden is back again, this time with face recognition.

  • @mohamedhamod2705
    @mohamedhamod2705 3 ปีที่แล้ว +1

    I Want Face recognition with Famous Face recognition algorithms:
    1-PCA
    2-LDA
    3-SVM
    4-SURF
    5-LBPH

  • @amarjeetkushwaha4258
    @amarjeetkushwaha4258 4 ปีที่แล้ว

    Thanks buddy waiting for neural networks

    • @sentdex
      @sentdex  4 ปีที่แล้ว +2

      Very soon

    • @kanybekasanbekov2955
      @kanybekasanbekov2955 4 ปีที่แล้ว

      @@sentdex Are you going to make videos for "Neural networks from the scratch" book?

  • @deckplate1
    @deckplate1 4 ปีที่แล้ว

    I would love to see you tackle the PennyLane library (Quantum Neural Networks). Since you are the bleeding edge of codetubers and all

  • @shitalgodara3766
    @shitalgodara3766 2 ปีที่แล้ว +1

    great tutorial !! while using Png it is working fine with training data and test data
    but while working with jpeg images it is not working my error is
    encoding = face_recognition.face_encodings(image)[0]
    IndexError: list index out of range
    and images i am using are both same i had jpg images which i converted into Png images then it is working previously it wasn't

  • @anupambadola1209
    @anupambadola1209 4 ปีที่แล้ว +1

    operands could not be broadcast together with shapes (3973,) (128,) . This error is coming when I am using your code at line (results = face_recognition.compare_faces(known_faces, face_encoding, TOLERANCE)). I am fedup with this I am not able to understand what shape I used your code as it was.

  • @bfuturep2717
    @bfuturep2717 4 ปีที่แล้ว

    f string is bad way for concating path because there might be cases where spaces left of double slashes ("//") appended because of forward slash added in prev strign at end and next string in first, say "known_dir/" "/name" human can miss pattern on a large scale project.

  • @Sirfrigth
    @Sirfrigth 4 ปีที่แล้ว

    Hello! This is really helpful! Thank you! Im not very good at programming and the teacher had us to make a face recognition program as the last assignment so I'm clueless on many things! I would like to use this tutorial to start my assignment but we are not allowed to use any machine learning package/module and we cannot use any built-in/ready to use linear regression functions. So I more lost than ever of how to start. Do you have any advice? We have to use an algorithm and not sure how to implement it on python.

  • @erwinrommel5593
    @erwinrommel5593 4 ปีที่แล้ว +1

    can u tell me why is it throwing a value errorr return np.linalg.norm(face_encodings - face_to_compare, axis=1)
    ValueError: operands could not be broadcast together with shapes (1,14) (128,)

    • @AnuragVarmaP
      @AnuragVarmaP 4 ปีที่แล้ว

      how did u solve it, plz say

  • @waeddawaghreh8460
    @waeddawaghreh8460 4 ปีที่แล้ว

    I hope u can do another tutorial with video , Thank u anyway that was really helpful

  • @lautarodapin
    @lautarodapin 4 ปีที่แล้ว

    Finnaly a video! wuju!

  • @neildutoit5177
    @neildutoit5177 3 ปีที่แล้ว

    "If anyone knows why not to use f strings for paths" Pretty sure it's the same reason we didn't use concatenation before: it isn't operating system independent. os.path is.

  • @amazingshorts2131
    @amazingshorts2131 4 ปีที่แล้ว +2

    AttributeError: module 'dlib' has no attribute 'get_frontal_face_detector'
    can any help me to solve this i am using python version 3.8

  • @augpie4249
    @augpie4249 4 ปีที่แล้ว

    In order to work properly, you need to download visual studio build tools, then install C++ Build Tools

  • @rohitjg
    @rohitjg 4 ปีที่แล้ว +1

    i am getting this error while running the code : encodeing = face_recognition.face_encodeings(image)[0]
    AttributeError: module 'face_recognition' has no attribute 'face_encodeings'
    is there anyway to fix this.

  • @artaa8233
    @artaa8233 4 ปีที่แล้ว

    Thanks a lot, useful. Is it possible to change MODEL with a pytorch or keras model?

  • @karenkoh9154
    @karenkoh9154 2 ปีที่แล้ว

    hello thanks for the video. But I have a doubt with this library, is there a function to know the confidence and accuracy of our system?

  •  4 ปีที่แล้ว +1

    Great Video! Thank you!
    How can we understand which CNN algorithm (model) used there?

  • @KingDuken
    @KingDuken 4 ปีที่แล้ว

    Hey nice tutorial. Will definitely check it out. Do you happen to know if it detects things like objects and animals, etc.?

  • @zigzag4273
    @zigzag4273 4 ปีที่แล้ว

    Hey Harrison, coming from a CompSci background, how heavy on statistics is ML/AI?

  • @whoever2910
    @whoever2910 4 ปีที่แล้ว +1

    I really love your videos. Good job. I have a question. When I run this code I get the error: IndexError: list index out of range. The error is for the part when you type face_encodings(image)[0]. When I type 1 instead of 0 I get the same error. When I delete the [0] completely the error goes away but later a get a different error. Can you help me with this?

    • @AnuragVarmaP
      @AnuragVarmaP 4 ปีที่แล้ว

      did u solve it, i have the same error

    • @AnuragVarmaP
      @AnuragVarmaP 4 ปีที่แล้ว

      how to solve it

    • @whoever2910
      @whoever2910 4 ปีที่แล้ว

      @@AnuragVarmaP yeah I kinda solved it. I get this error only if I put too many faces in the known faces folder. I think around 8 is the limit but I'm not sure. When I remove some of them it works again.

    • @whoever2910
      @whoever2910 4 ปีที่แล้ว

      @@AnuragVarmaP yeah I kinda solved it. I get this error only if I put too many faces in the known faces folder. I think around 8 is the limit but I'm not sure. When I remove some of them it works again.

    • @AnuragVarmaP
      @AnuragVarmaP 4 ปีที่แล้ว +1

      i put like 3000 images, lol

  • @melaineeuzenat4030
    @melaineeuzenat4030 4 ปีที่แล้ว

    A valid reason not to use f-strings for paths? The pathlib library. It is built-in, it uses / for paths (overriding the division operator), it has the glob method available for any path, etc. By the way: love your Channel!

  • @BrandonJacobson
    @BrandonJacobson 4 ปีที่แล้ว

    I can't install the face_recognition library. I'm using PyCharm and Windows 10. I'm getting cmake, dlib, and path errors. Anyone have a link to help install all of this?

  • @magnusmagalhaes8169
    @magnusmagalhaes8169 4 ปีที่แล้ว

    Hi. I'm having issues with the list out of range when I run the program with some photos. Could it be that the program is no recognizing the face?
    Excellent work Sentdex.Congrats.Error bellow:
    " File "ee.py", line 38, in
    encoding = face_recognition.face_encodings(image)[2]
    IndexError: list index out of range
    "

    • @sentdex
      @sentdex  4 ปีที่แล้ว

      Maybe no face found in one of your known faces

    • @DonRichards
      @DonRichards 4 ปีที่แล้ว

      @@sentdex I got the same error. I used a face dataset from susanqq.github.io/UTKFace and I'm getting the same error.

  • @heremeaccount
    @heremeaccount 3 ปีที่แล้ว

    what is the editor you are using so we can do the same as you

  • @jalopyjones6460
    @jalopyjones6460 4 ปีที่แล้ว

    26.43 the answer = Ubuntu lmao... also, are you using python3/pip3 as i see you just typing "python" or "pip" and not "python3" or "pip3" other than that keep up the great work and thank you for your time and knowledge!

  • @raghavagarwal633
    @raghavagarwal633 4 ปีที่แล้ว +1

    Hi Sir! I faced an error while running the code. Please help me to figure out this.
    encoding = face_recognition.face_encodings(image)[0]
    IndexError: list index out of range
    Thanks in advance!

    • @akirasuzuki6650
      @akirasuzuki6650 4 ปีที่แล้ว +4

      Hey- I'm not sentdex, but I had the same problem as you- what I did was first check to see if the known images even detected a face in the first place by doing:
      if len(face_recognition.face_encodings(image)) > 0:
      and then indented the code after that in the loop. Hopefully that helps!

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 4 ปีที่แล้ว

    great video!

  • @manikumardonepudi665
    @manikumardonepudi665 4 ปีที่แล้ว +1

    ValueError: operands could not be broadcast together with shapes (5603,0) (128,)
    how can I over come this error

  • @HamroMotors
    @HamroMotors 4 ปีที่แล้ว

    It says: ModuleNotFoundError: No module named 'face_recognition'
    while doing pip install face-recognition in cmd
    Can anyone help me?

    • @RANKKY9
      @RANKKY9 4 ปีที่แล้ว

      It seems like Windows is not officially supported as it says here: pypi.org/project/face-recognition/#requirements

  • @tsadarsh2403
    @tsadarsh2403 4 ปีที่แล้ว

    I am eagerly waiting for Neural networks from scratch videos. Will it be coming anytime soon?

  • @bidhanmajhi
    @bidhanmajhi 4 ปีที่แล้ว +2

    Having problem installing dlib. Installed cmake first but still there's error. Stack overflow didn't help either

    • @shobhitbishop
      @shobhitbishop 4 ปีที่แล้ว

      I faced the same issue, try using pip install dlib = 19.8.1

    • @meshkatshadik
      @meshkatshadik 4 ปีที่แล้ว

      @@shobhitbishop Okay! How I install dlib and face-recognition. I think, why VS (visual studio)? I use VS 2017 community. VS '17 is for installing Cmake c++ library nothing much!!
      I type in the Pycharm's terminal 'pip install dlib', then my pc hanged out for 5 minutes. I got afraid! Then after 20 minutes, I see the successful message. Then just type 'pip install face-recognition' and boom!!
      Note : I installed cmake!

  • @pipi_delina
    @pipi_delina 4 ปีที่แล้ว +2

    I get this error when I tested the code tho...
    return np.linalg.norm(face_encodings - face_to_compare, axis=1)
    ValueError: operands could not be broadcast together with shapes (6,) (128,)

    • @painfgaming8229
      @painfgaming8229 4 ปีที่แล้ว

      yes I'm getting the same error do let me know if you find fix

    • @painfgaming8229
      @painfgaming8229 4 ปีที่แล้ว

      @sentdex I'm also getting this error

    • @Killer-mx7tr
      @Killer-mx7tr 4 ปีที่แล้ว +2

      this happens if there is no face found in known images, just add an if statement to see if encoding has any elements before appending it :
      ...
      encoding = face_recognition.face_encodings(face)
      if encoding :
      knownFaces.append(encoding)
      ...

  • @benjaminbianchi1804
    @benjaminbianchi1804 4 ปีที่แล้ว +5

    28:36 hahahahhaha 🤣 , great video !!!

  • @dhanrajshastri4936
    @dhanrajshastri4936 4 ปีที่แล้ว +3

    has anyone tried running this on mac and pycharm my laptop starts lagging and the code isnt giving out an error but it stops working after the first for loop

    • @yubrajupreti60
      @yubrajupreti60 4 ปีที่แล้ว

      It due to the load of the program . I prefer u to use model="hog" instead of cnn .it may solve your issue

  • @taqikhan5418
    @taqikhan5418 3 ปีที่แล้ว

    Thanks .Please make for real time face recognition

  • @vineethmothukuri1476
    @vineethmothukuri1476 4 ปีที่แล้ว +1

    Hi , i got
    CMake Error at CMakeLists.txt:3 (project):
    No CMAKE_CXX_COMPILER could be found. even though cmake is installed

    • @prabhanshuchauhan4150
      @prabhanshuchauhan4150 4 ปีที่แล้ว

      me too .. I tried adding compilers path to environment var but it didn't work

  • @lucaspioli7970
    @lucaspioli7970 2 ปีที่แล้ว

    Hey, love the tutorial but i got an error that i cant fix, ValueError: operands could not be broadcast together with shapes (22,) (128,).
    Also if i use the index to detect faces it says im out of range. No clue.

  • @v1hana350
    @v1hana350 2 ปีที่แล้ว

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

  • @ranarashid7483
    @ranarashid7483 3 ปีที่แล้ว

    I am getting the following errors
    "VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    return np.linalg.norm(face_encodings - face_to_compare, axis=1)"
    "ValueError: operands could not be broadcast together with shapes "

  • @spicytuna08
    @spicytuna08 4 ปีที่แล้ว

    would this work with objects? live detecting screwdrivers vs. hammers. I have like 180 broad groups. great stuff. thanks a lot.