Live Face Recognition in Python

  Рет қаралды 137,514

NeuralNine

NeuralNine

Жыл бұрын

In this video, we learn how to implement a live face recognition system in Python using machine learning and OpenCV.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер: 141
@sefiks
@sefiks 6 ай бұрын
Hey 👋 I'm the creator of DeepFace. Thank you for sharing this video to the community.
@benwilliams5622
@benwilliams5622 5 ай бұрын
why does my program say :The conflict is caused by: deepface 0.0.80 depends on tensorflow>=1.9.0 when trying to install deepface
@sefiks
@sefiks 5 ай бұрын
@@benwilliams5622 you may have older tf version
@AB-cd5gd
@AB-cd5gd 4 ай бұрын
​@@benwilliams5622try installing tensorflow and updating it
@user-iu6be3rw7l
@user-iu6be3rw7l 3 ай бұрын
how it works? face color recognition?
@user-yw2vy2qp5d
@user-yw2vy2qp5d 3 ай бұрын
i think its @@user-iu6be3rw7l
@Mete-Hans
@Mete-Hans Жыл бұрын
Your are explaining very clean and it's easy to understand thanks for video.
@prashantbhosale6745
@prashantbhosale6745 3 ай бұрын
I have been following you for the past year, and each time you release new and exciting videos, I thoroughly enjoy them and learn a lot. Thank you so much for creating such amazing content. Keep up the great work!
@mrkewi1
@mrkewi1 8 ай бұрын
don't stop bro. you're awesome
@PristineMedal02
@PristineMedal02 6 ай бұрын
I'd like to ask, is tensor cores required for this live face recognition? I have a ultrabook and I wonder if this can run on my laptop. If not, can you give me some projects using Python 3.12 and OpenCV with same features? thank u so much
@learn4me6
@learn4me6 Жыл бұрын
Thanks for sharing. I think the Time complexity of this code is quadratic, n squared?
@AhmadHalabi001
@AhmadHalabi001 Жыл бұрын
Awesome, Thanks for sharing this!
@aminhamdi6619
@aminhamdi6619 Жыл бұрын
hhere's the code guys " import threading import cv2 from deepface import DeepFace cap = cv2.VideoCapture (0) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) counter = 0 face_match = False reference_img = cv2.imread("reference.jpg") def check_face(frame): global face_match try: if DeepFace.verify (frame, reference_img.copy())['verified']: face_match=True else: face_match=False except ValueError: face_match=False while True: ret, frame = cap.read() if ret: if counter % 38 == 8: try: threading. Thread(target=check_face, args=(frame.copy(),)).start() except ValueError: pass counter += 1 if face_match: cv2.putText(frame, "MATCH!", (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0), 3) else: cv2.putText(frame, "NO MATCH!", (20, 450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255), 3) cv2.imshow("video", frame) key = cv2.waitKey(1) if key == ord("q"): break cv2.destroyAllWindows()
@sambhavmohanty8800
@sambhavmohanty8800 Жыл бұрын
Thank you
@mihaelafranjic8224
@mihaelafranjic8224 3 ай бұрын
Thank you! Is there any chance that we can connect Phyton to other camera and then detect when someone is seeking for help, are they feeling safe or do they trust to the product?
@PANDURANG99
@PANDURANG99 10 ай бұрын
Instead of web cam I wants to use live desktop screen to detect objects, is it possible? And show in desktop rectangle itself?
@ellisondoe2759
@ellisondoe2759 10 ай бұрын
thanks this video was really helpful
@user-vz5ku4mi1y
@user-vz5ku4mi1y 6 ай бұрын
is Deepface compatible with OPENCL or RocM ? Cannot install CUDA drivers due to AMD Radeon graphics card
@artsaward3983
@artsaward3983 7 ай бұрын
great video i love it but mine says that there is no attribute named copy. can you help?
@threethosphimjun4836
@threethosphimjun4836 Жыл бұрын
Thank you so much!
@user-kd5nj7ou4i
@user-kd5nj7ou4i 2 ай бұрын
please tell me any mentor , which field is best in python except data science or AI
@Bright-Great
@Bright-Great 7 ай бұрын
can it work in web application in both desktop, android and iPhone
@siddhartmodi4117
@siddhartmodi4117 Жыл бұрын
How much time does it takes to run?
@hipockt4
@hipockt4 8 ай бұрын
Is it possible using the same technique to build a biometric passport photo creator
@codewithazam3750
@codewithazam3750 10 ай бұрын
whats the shortcut for zooming out in python
@clintjakealfante3101
@clintjakealfante3101 4 ай бұрын
Do I need to download deepface separate?
@_SanjayBiswas
@_SanjayBiswas Жыл бұрын
Super Cool!
@hotviissp8
@hotviissp8 7 ай бұрын
code works in intelij but doesn't work when i pack it in .exe file via pyinstaller. firstly gives an error: "autograph is not available in this environment: functions lack code information. this is typical of some environments like the interactive python shell". then program starts to work, but tasks with face recognition doesn't do anything. what should i do?
@honzosaurus42069-no_furry
@honzosaurus42069-no_furry 6 ай бұрын
I think pyinstaller doesn't support all of the libraries for python, which sucks. I actually made a KZbin video downloader today, with tkinter and pytube. It worked, but when I packed it as an exe, it couldn't even run and gave me an error that I don't even remember.
@CLouis-vr8ut
@CLouis-vr8ut 11 ай бұрын
Hi, i like your video. Can you make a video about how you learn new things and how to get the right information?Danke!
@tcgvsocg1458
@tcgvsocg1458 Жыл бұрын
its really funny to see the younger youtuber become older ^^
@mohamedel-adl996
@mohamedel-adl996 3 ай бұрын
hi, i'm wathed your tutorial several times and i even copied your could but i get this error every time ,could you help me with it : File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py\h5f.pyx", line 102, in h5py.h5f.open OSError: Unable to synchronously open file (truncated file: eof = 4653056, sblock->base_addr = 0, stored_eof = 580085408)
@Wootcabage
@Wootcabage 2 ай бұрын
For me it works if i use a refrence image and i hold up the same exact image infront of the camaar, but if i use a refrence image of me and actually go infront of the camara it does not work
@abudanish196
@abudanish196 Ай бұрын
It is not working for me. It keeps running forever.
@user-ku1gk8eq6h
@user-ku1gk8eq6h Ай бұрын
same man
@pranathikamisetty1662
@pranathikamisetty1662 7 ай бұрын
what if we have to use for a data set
@matheusrolim8723
@matheusrolim8723 7 күн бұрын
the code is working partially, the camera pops up but dont show any message of match or no match (using a macbook air and pycharm), can you help me?
@harunkenan4552
@harunkenan4552 Жыл бұрын
Awesome
@Sternhammer89
@Sternhammer89 6 ай бұрын
Hi, excellent tutorial. I am running this on a Macbook OSX 10.15.7, OpenCV version 4.6.0. First issue I had seemed to point to protobuf, so I uninstalled the current version and installed protobuf 4.21.5. Now when I start the program the only message I receive is: "2023-12-03 10:10:14.984020: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags." I get no video window?
@Sternhammer89
@Sternhammer89 6 ай бұрын
OK so I had spelt HERESHY incorrectly :-) should have been HERSHEY!! My bad. However I never seem to get a face match?
@Sternhammer89
@Sternhammer89 6 ай бұрын
Sorry sorted now, seems to be working.
@anandjs8612
@anandjs8612 6 ай бұрын
@@Sternhammer89how’d you fix it
@Sternhammer89
@Sternhammer89 6 ай бұрын
@@anandjs8612 Which part? Once I had installed protobuf 4.21.5 and corrected my spelling of HERSHEY it just worked. At first I thought it was not working when I received the message about Tenserflow Binary, but after a few more seconds the video windowed opened and started to work.
@anandjs8612
@anandjs8612 5 ай бұрын
@@Sternhammer89 ok interesting. For me I’m just always getting no match
@sirkudos3666
@sirkudos3666 Жыл бұрын
Good one
@acunamercadoroyermarcelo6911
@acunamercadoroyermarcelo6911 11 ай бұрын
same error: I cant understand why this appears in terminal "vgg_face_weights.h5 will be downloaded..." and never ends, so then it is everytime No Match. Can you explain what is "vgg_face_weights.h5 will be downloaded..."
@mohitgarg5081
@mohitgarg5081 9 ай бұрын
Same problem
@mohitgarg5081
@mohitgarg5081 9 ай бұрын
I also can't understand
@mohitgarg5081
@mohitgarg5081 9 ай бұрын
Plz tell me
@SpHavFun
@SpHavFun 8 ай бұрын
I just increased time from %30 to %1000 and after to %100, then wait until weights download complete (100%). All running good.
@gilstechlife8962
@gilstechlife8962 5 ай бұрын
How did you get it to finish downloading?
@hasson2349
@hasson2349 Жыл бұрын
Why do you use threads here? How does it improves the code and in general, when to use threads?
@ibrahimyusufgarba1243
@ibrahimyusufgarba1243 7 ай бұрын
to handle multi-task processing at the same time
@TheUnofficialMaker
@TheUnofficialMaker 9 ай бұрын
nice job
@bhattdevarsh
@bhattdevarsh Жыл бұрын
Are you planning to upload source code on git?
@reubenanilarakkaparambil7787
@reubenanilarakkaparambil7787 6 ай бұрын
import threading import cv2 from deepface import DeepFace cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) cap.set(cv2.CAP_PROP_FRAME_WIDTH,640) cap.set(cv2.CAP_PROP_FRAME_HEIGHT,480) counter = 0 face_match= False reference_image = cv2.imread(r"c:\Users\Reuben Anil\PycharmProjects\pythonProject3\deepface\selfie.jpeg") def check_face(frame): global face_match try: if DeepFace.verify(frame, reference_image.copy())['verified']: face_match=True else: face_match=False except ValueError: print("Upar ka Value Error") face_match=False while True: ret, frame = cap.read() if ret: if counter % 30 == 0: try: threading.Thread(target=check_face, args=(frame.copy(),)).start() except ValueError: pass print("Not a Match") counter += 1 if face_match: cv2.putText(frame, "MATCH!", (20,450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0,255,0), 3) else: cv2.putText(frame, "NOT A MATCH!", (20,450), cv2.FONT_HERSHEY_SIMPLEX, 2, (0,0,255), 3) cv2.imshow("video", frame) key = cv2.waitKey(1) if key == ord("q"): break cv2.destroyAllWindows()
@computerman4441
@computerman4441 5 ай бұрын
How can i download deepface module?!
@AKKJ420
@AKKJ420 Жыл бұрын
Mate do a tutorial for live number plate recognition anpr system. Most of them are paid services. Thanks for the video anyway.
@gravitycore1
@gravitycore1 21 күн бұрын
So would this particular project fall under machine learning?
@vimukthisadithya6239
@vimukthisadithya6239 2 ай бұрын
I'm encounting with the error TypeError: unhashable type: 'list' can I know the specific library versions that has been used on this project ?
@arturasstonys9404
@arturasstonys9404 Ай бұрын
I got the same error even though I cannot find some references in internet regarding this problem. Seems weird :/ The error apears in line "from deepface import DeepFace" so there is something wrong with the library itself
@clintjakealfante3101
@clintjakealfante3101 4 ай бұрын
What IDE are you using for coding in the video?
@abdelhake2673
@abdelhake2673 3 ай бұрын
Pycharm if you are still interested
@dipankarshaw900
@dipankarshaw900 10 ай бұрын
Pair this with his object detection python script and you got a security camera
@kilimanjaro8075
@kilimanjaro8075 Ай бұрын
thank you so much for explaining this cool project
@prashantbhosale6745
@prashantbhosale6745 3 ай бұрын
I am facing a challenge to extract the specific field data from pdf file , how to extract efficiently . please make a video on this
@benezer4937
@benezer4937 11 ай бұрын
Hey man, great tutorial! But I would like to ask, what if u want to have multiple face reference?
@jeffluminosity-staunch1579
@jeffluminosity-staunch1579 11 ай бұрын
Just have another reference img.jpg and name it reference img 2.jpg and write Cv2.imread(reference img .jpg , reference img 2. jpg) and add 3 , 4 as many as you like just make sure to reduce the counter percentile in half(15%) per reference img since it is now looking for 2 or more faces per single frame that should do the trick.
@kasozimarktum4925
@kasozimarktum4925 11 ай бұрын
Hey man... mine doesn't work
@jeffluminosity-staunch1579
@jeffluminosity-staunch1579 11 ай бұрын
@@kasozimarktum4925 make sure that numpy and cv are up to date and also the first time you are going to start the program it will start by downloading the reference img that you had put in so it will take a bit more time at first to start you should see the img being downloaded in the terminal if the counter percentile makes it so that it keeps on triggering the download again and again just increase the percentile to 3500000000% (Something large) so that it may have time to download the img later just put counter back to normal. Hope this helps!
@mohamedfatheddine1447
@mohamedfatheddine1447 4 ай бұрын
@@jeffluminosity-staunch1579still claims No Match, can you help me please
@jeffluminosity-staunch1579
@jeffluminosity-staunch1579 4 ай бұрын
@@mohamedfatheddine1447 is your reference img file in the same folder as the program? if yes than know that your reference img must be taken at the same lighting as you are testing, If that does not work I will recommend to either look for errors in the code or to re-write the complete code again at this point it really comes down to how determined you are to have a security face recognition :)
@petersignore9547
@petersignore9547 Жыл бұрын
So I have the file running of my photo, but it isn't recognizing the image, still claims NO MATCH continuously
@LoveMotorist
@LoveMotorist 11 ай бұрын
same for me.. no match is always there, maybe there are specifications for the size of the reference image
@mohitgarg5081
@mohitgarg5081 9 ай бұрын
Same plz tell me how can i solve this problem
@ibrahimyusufgarba1243
@ibrahimyusufgarba1243 7 ай бұрын
The same also showing NO MATCH always.
@mohamedfatheddine1447
@mohamedfatheddine1447 4 ай бұрын
Same problem if someone can help me
@bhavyamittal3418
@bhavyamittal3418 4 ай бұрын
I am too getting the same error
@rohitsharma9755
@rohitsharma9755 2 ай бұрын
what is reference .jpg
@vlogsunlimited6735
@vlogsunlimited6735 6 ай бұрын
Bro create a code to crate handwriting in NOTE PAD
@snup2926
@snup2926 Жыл бұрын
Guys, how can i run this code in visual studio? I am kinda new here
@Just_Hu
@Just_Hu Жыл бұрын
F5 to run codes
@aaravakshayshah7527
@aaravakshayshah7527 11 ай бұрын
can you upload the source code
@fintech1378
@fintech1378 4 ай бұрын
Can you cover GPT4V on CCTV?
@adithyawanasinghe3082
@adithyawanasinghe3082 7 күн бұрын
What is this python version
@joshualampitoc6199
@joshualampitoc6199 11 ай бұрын
How can i add reference image
@juniorberard9611
@juniorberard9611 3 ай бұрын
lll
@Lithium59
@Lithium59 Ай бұрын
Someone is probably working on a python iphone with neuralnine's videos
@akshithkrishnabanda
@akshithkrishnabanda 7 ай бұрын
Bro it is showing nomatch for me
@artbuddy5043
@artbuddy5043 28 күн бұрын
can u do this with raspberry pi
@MegaTommy105
@MegaTommy105 8 ай бұрын
set off my shotgun trap when it recognizes me o7
@HomeRunRealEstate-xi3rm
@HomeRunRealEstate-xi3rm 2 ай бұрын
Cool
@4lex355
@4lex355 2 ай бұрын
this is not working for me. i run the code and there is no window opening with image of the camara.
@rolandfebrian6711
@rolandfebrian6711 Ай бұрын
same
@4lex355
@4lex355 Ай бұрын
@@rolandfebrian6711 i think i fixe it. You have to change the number.
@goldloli2638
@goldloli2638 9 ай бұрын
Traceback (most recent call last): File "d:\20a31a4429\Face.py", line 3, in import opencv as cv2 ModuleNotFoundError: No module named 'opencv' 😔 What should I do?
@mmigi3095
@mmigi3095 9 ай бұрын
instead of writing "import opencv as cv2" just write "import cv2"
@mrkewi1
@mrkewi1 8 ай бұрын
try this: import cv2 as cv. then you can use cv instead of writing cv2
@viswaksena4013
@viswaksena4013 7 ай бұрын
Wow, next level issue ig no one can solve #airanevanchalaenti
@flapjack7301
@flapjack7301 9 ай бұрын
pip doesnt work, im using python 3.11 and dont know what to do
@Wootcabage
@Wootcabage 2 ай бұрын
you have to install pip or somthing. I did not know what to do and a quick google searche helped me. I searched somthing like how to get pip(Im not sure what i did couse i am rechecking theses comments aftersome time couse i needed some information)
@ujwalpathak278
@ujwalpathak278 5 ай бұрын
can I get the source code
@baekrackjune6944
@baekrackjune6944 Жыл бұрын
Hi I allways Thanks> I hasve deepface.verify([frame, reference in.copy()])['verified'] 'nonetype' object has no attribute 'copy' please help~~
@shashaankkota9020
@shashaankkota9020 Жыл бұрын
Getting the same error were u able to fix it ?
@Alex-ul2eo
@Alex-ul2eo Жыл бұрын
@@shashaankkota9020 no square brackets
@danacosta5237
@danacosta5237 Жыл бұрын
I have the same error, i wrote a test and the imread function is reading in the image properly so idk what the issue is
@venzi5924
@venzi5924 Жыл бұрын
were you able to fix it?
@danacosta5237
@danacosta5237 Жыл бұрын
@Venzi no, im gonna try just using a different library. I think theres one called facial_recognition or something using opencv
@gergohorvath2538
@gergohorvath2538 Жыл бұрын
It’s strange that you set check_face to every 30 secs but it detected match and no match immediately
@godakartik8110
@godakartik8110 Жыл бұрын
it is set to every 30 FRAMES. not every 30s. since video is at 30 frames/sec, we can see a match/no match every 30 frames i.e., every 1 sec
@muhibmallick7708
@muhibmallick7708 Жыл бұрын
i don't know if your camera is good or what but its not recognizing me.
@pranathikamisetty1662
@pranathikamisetty1662 7 ай бұрын
it didnt work for me
@dombomb4147
@dombomb4147 9 ай бұрын
My computer cant handle it, but thanks anyway!
@karansinghraghav1586
@karansinghraghav1586 10 ай бұрын
Bro it shows no match always 😢
@arkajyotipal6205
@arkajyotipal6205 2 ай бұрын
Same Problem here. I thought maybe my laptop camera sucks so I even tried using my phone's rear camera using DroidCam and still it keeps saying No Match
@thuyhuong3402
@thuyhuong3402 6 ай бұрын
i can't install deepface
@arkajyotipal6205
@arkajyotipal6205 2 ай бұрын
It just says 'No Match'
@g.kaviyagurunathan7543
@g.kaviyagurunathan7543 4 ай бұрын
Source code
@Kaganerkan
@Kaganerkan 9 ай бұрын
It didint work.
@user-hl7bh3dx8d
@user-hl7bh3dx8d 20 күн бұрын
write a code
@duyduy5595
@duyduy5595 12 күн бұрын
Why don’t you just make python comments instead of talking??? You better create a very simple program then adding it up to the final level it would be much more easier to people to grab it
@ham4497
@ham4497 Жыл бұрын
A je shqiptar
@mrirfan__07
@mrirfan__07 Жыл бұрын
sir plz provide code sir not provide any videro 😠
@asilbekqurbonov5168
@asilbekqurbonov5168 8 ай бұрын
can you send the code, please
Python Face Recognition (Beginner Tutorial)
12:36
Matthew Berman
Рет қаралды 38 М.
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 96 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 8 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 11 МЛН
XBOX Game Pass FREE For 3 Months For Everyone!🤯🔥
6:17
Your Tech Support & Gaming
Рет қаралды 3 М.
Face recognition in real-time | with Opencv and Python
28:19
Pysource
Рет қаралды 248 М.
Multi person Real time Action Recognition Based on Human Skeleton
1:28
Face Recognition in Python |Real-time |  Part 2 | FaceNet, MTCNN, SVM
21:53
Coding Web Crawler in Python with Scrapy
34:31
NeuralNine
Рет қаралды 99 М.
OpenCV Python TUTORIAL #4 for Face Recognition and Identification
1:06:24
CodingEntrepreneurs
Рет қаралды 806 М.
Face Recognition with Real Time Database | 2 Hour Course | Computer Vision
2:20:18
Murtaza's Workshop - Robotics and AI
Рет қаралды 526 М.
Face recognition + liveness detection: Face attendance system
29:33
Computer vision engineer
Рет қаралды 104 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,6 МЛН
Mi primera placa con dios
0:12
Eyal mewing
Рет қаралды 503 М.
Which Phone Unlock Code Will You Choose? 🤔️
0:14
Game9bit
Рет қаралды 13 МЛН
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 7 МЛН
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 23 МЛН