Build a Deep Face Detection Model with Python and Tensorflow | Full Course
HTML-код
- Опубликовано: 19 июн 2024
- Learn how to build a face detection model using an Object Detection architecture using Tensorflow and Python!
Get the code here: github.com/nicknochnack/FaceD...
Links
github.com/wkentaro/labelme
albumentations.ai/docs/gettin...
www.tensorflow.org/api_docs/p...
Chapters
0:00 - START
0:38 - Explainer
1:38 - PART 1 - COLLECt IMAGES & ANNOTATE
2:22 - Breakdown Board
8:51 - Setting up and Getting Data
32:47 - PART 2 - PARTITION & AUGMENT DATA
34:11 - Review dataset and build Image Loading Function
45:32 - Partition Unaugmented Data
53:08 - Apply Image Augmentation on Images and Labels
1:07:10 - Build and Run Augmentation Pipeline
1:15:10 - Prepare Labels
1:19:04 - Combine Label and Image Samples
1:24:57 - PART 3 - BUILD & TRAIN THE DEEP LEARNING MODEL
1:26:09 - Build a Deep Learning Model using the Functional API
1:41:20 - Defining a Custom Loss Function & Optimizer
1:45:51 - Train a Neural Network
2:03:25 - PART 4 - TEST AND PERFORM REAL TIME DETECTIONS
2:18:28 - Final Results
2:25:42 - Ending
Oh, and don't forget to connect with me!
LinkedIn: bit.ly/324Epgo
Facebook: bit.ly/3mB1sZD
GitHub: bit.ly/3mDJllD
Patreon: bit.ly/2OCn3UW
Join the Discussion on Discord: bit.ly/3dQiZsV
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand!
#deeplearning #python Наука
This is great, Nick! Appreciate all the effort you put in to make all the tutorials amazing.
1 hour through the video and i can already feel that this video has got a lot more clarity, simplicity and less errors(of-course) than the last object detection video
Just came across your channel. Mad props for working through your mistakes instead of editing them out. Keep it up! 👏👏
This video could not have come at a better time for me. I jumped through it and will be returning next week to watch it all. Thanks for this! You also got a sub from me.
Thanks Nick! A very great video on Object detection, I have also followed your previous TFOD course. Great effort in making a lengthy video that helps us a lot! Kudos!
You are awesome Nick. This is what precisely what I need and the whole community is need.
tysm! i've been trying to create a model like this for a while now, and this is the first one i found that works! you're a life saver!👊
I like the video, explanations are clear and to the point. But I've to admit, I like it when people type out the code from scratch instead of reviewing code. Thanks for the tutorial.
Awesome tutorial, man! I especially appreciate part where you show you debug process, really useful.
thank you!! it helped a lot to build face detector from stratch and i've learned tons of things from you, really appericiated
dude really amazing work! got it all working this time! really happy with the outcome! tyvm
Your video is amazing! It's engaging and practical.
I also love how this is similar to your video from 2 years ago, but shorter :)
A huge appreciation for you nick to putting this together
Great video, Nick! Thank you for putting this together!
Wonderful presentation. Very nice imagery and explanation.
Hi, Nick!. This is so help me to understanding about build one of deep learning method, especially with tensorflow. Thank you so much for your effortS to make it done your amazing tutorial. I hope you more have a fantastic what you done next.
one of the few youtube channels that actually can be taught from - super rar , thank you so much for your work 🙏🙏🙏🙏🙏🙏🙏🙏🥳🥳🥳🥳
Amazing video! Can’t wait for real time speech recognitizion with python tensorflow🤩🤩
That was a really great video. And I'd really like the idea of making one where the images are multi labeled!!
A multiclass object detection with data augmentation pipeline would be LIT !!!! Great work as always :)
Hey! It is possible, you just have to add N coordinates into array and add N labels into class_labels
@@maximeentsi2205 can you clarify more where exactly is it?
@@user-gu9hg5pu4c There are many changes, you have to adapt your code in order to read array of many coords, etc. I haven't finished adapting everything yet, I even have to change the outputs of the neural network, but I think it's feasible.
@@maximeentsi2205 Yea right, I think where it gets tricky is that the whole structure in this video is like a binary classification problem. Converting that to accept multiple classes might be confusing..
@@maximeentsi2205 did u finish it?
Thank you Nick! Always love your videos.
This video truly helped me a lot, thanks!
this was much more accurate than the one you did in the last tutorial great job man👏🔥
Yeah ton of lessons learned from that one!
Congrats, im learning to much with you
Hi Nicholas, I loved the tutorial but have one suggestion. You have extended the Model class and implemented FaceTracker class to fit multiple loss functions. But you could have used the Keras' Model.compile() parameters - loss, loss_weights to pass both the loss functions and their corresponding weights as arguments and avoided the FaceTracker class.
model.compile(optimizer = opt, loss = [loss1, loss2], loss_weights = [weight1, weight2])
Keep it up Nicholas! 100K follows it's getting closer 💪💪💪
Amazing work. I love your channel.
Hi Nicholas your youtube channel is great. i appreciate you
Thank you so much ! a very interesting tutorial
Thank Very much nicholas you explained easier
Thanks a ton for all your effort :)
I really appreciate the throrough explanation of the code as you are working through the projects. Thank you so much. Very helpful and insightfull.
Samll request. Can you please do a project to classify and image in runtime? This was part of an assignment for my course and I am not
sure if this tutorial covers that part of the classification process. please advise..
Great tutorial, Nicholas! Thanks for putting this together!
Suggestion for 40:10 , loading the image pipeline: this string will not work for Mac/ Linux, I think. I converted it to os.path.join("data", 'images", "*.jpg") for more robustness in the system.
Thank you!!
After watching full 2h long video...Felt like "Ureka". Great Job 👍
Hahahah I know right!
Heads up, there's a very small typo in your chapters, the one for 34:11 has a space between the : and the 11 in your description, making it not show up as a chapter/timestamp in the video at all :)
Really love this video, huge huge thanks for all the work, time and effort you put into this, much much appreciated! ❤
object detection is really really awesome, you can do so much with it.
Tons of usage examples, like the good ol' plant classification apps, but also for example quality control. My first thought for the latter was a PCB manufacturer using this to quickly detect faults (broken traces, bad solder joints or whatever) on their PCBs, but obviously even within that field alone, the possibilities are endless.
And it is probably much quicker than a human to pick up those errors and finds even pretty small faults and stuff, too. Super super useful.
And one has to say, TF is an awesome and super powerful library, the fact that they have SO many things included that you'll probably need for ML, even stuff like loading images and so on, makes creating your own ML apps so so much easier and quicker.
And the albumentations lib seems absolutely awesome! Saves a ton of work and/or headache by handling the labels automagically, gotta love it!
It's really really beautiful that people release their amazing software for public use like that, really gotta appreciate FOSS.
So yeah again, huge huge thanks for the video, much appreciated, really loving it! ❤
All the best, have an awesome weekend! :)
Fixed, you're an absolute legend! Agreed, it's insane how much open source stuff there is, albumentations is an absolute game changer. I just teamed up with a new team at work, there are so many new use cases we're going to be able to explore!
@@NicholasRenotte Hi Nick, please you did not add the confidence score in the bounding box in the detection. Pls, can you do that since I'm a beginner? Please help a brother. It will go a long way to help me in my research
hanks lot Sir.. You helping us..
This guy deserves more views :)
Hi Nick, really amazing video I liked how explained everything. Thank you so much. One more question how do you load the saved model when you want to use it again. Thanks for everything.
if anyone having x_max
It works! Awesome tutorial!
is it paid or full free project ?
The augmentation part began and my brain just left the chat....😂😂 Absolutely melted...🤯
still understood it after watching 2-3 times and understanding it with a fresh mind and also because it was Nich who was teaching it, it got way simpler than other videos/tutorials.... Thanks man❤🔥
The frame not displayed for me😢
@@BadShampooPubg which frame?
Hey Nick can you suggest how I can automatically assign bounding boxes and labels to a new image dataset and retrain the existing model to detect additional faces?
Nick great lab! Question for you. Do you have a work-around for installing tensorflow-gpu on a mac?
for the new coder watching video in 2024 tensorflow-gpu library has been disabled directly install tensorflow and opencv
hi, i am running above code as .py script, i am getting error:
Traceback (most recent call last):
File "E:\Vivek\PYTHON\Face_Detection\PartitionAndAugmentData.py", line 326, in
hist = model.fit(train, epochs=10, validation_data=val, callbacks=[tensorboard_callback])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\utils\traceback_utils.py", line 123, in error_handler
raise e.with_traceback(filtered_tb) from None
File "E:\Vivek\PYTHON\Face_Detection\PartitionAndAugmentData.py", line 295, in train_step
batch_classloss = self.closs(y[0], classes)
can you help me with this ?
@Nicholas Renotte When the pictures were taken I could not find them? Do you know where they are? I have also checked the Images folder/
Nice Nicholas. Thanks
thank you . You may teach about multi-object tracking, for example, using an algorithm deepsort. or ...
Or a project about football analysis in video
Hi Nick, did you train all layers in this tutorial, including the vgg layers? or the vgg layers were frozen?
Hi Nick, would really be fantastic if you could do a multiface detection system, i've manageed to learn a lot from your videos. thank you so much.
your really the DJ Khaled of AI bro hats off to you!
Hi @Nicholas, Thank you for this tutorial, it really helped. I will also like you to do a tutorial on detecting multiple objects on an image using SSD. Thanks
Hi Nick, what cuda version are you using in this video? can i used cuda 5.1? Great video very helpful.
Hi nick!, Can we actually use any type of deep learning model to control a servo motor ? Or the model must have a output of interpreter for the servo motor to understand ?
thanks u for uploading this amazing tutorial
Hi Nick, fantastic video as always. you are awesome. Would you please tell us how can we add multiple object detection, for instance, many faces? In the end, you have described some, but when I did the project couldn't run the real-time multiple!? how can I solve this, please?
I'm currently dealing with the same issue. Were you able to resolve this issue?
this guy is on fire delivering content we want🔥
Trying my best! Ain't stopping soon!
Hey nick!!
can we execute in our own laptops with normal cpu or we need gpu for this project??
Hello! We wanted to do sign detection with this tutorial, firstly entered one sign "hello", 30 images. It ended up showing bounding box, but it wasnt reacting on any move/sign. What should we change in this code to make it work?
Hey, Nick!!!
Can we use 'create polygon' for labeling in labelme??
as that may give better accuracy!!
Very well versed sir!! I had a question, much appreciated if you could help,
Could I use this same to classify between two different objects, say box with barcode and without barcode??
thank you so much for this video
This is awesome, Nick! How does the complexity increase if you want to identify multiple boxes in the image, and/or combine them together to identify empty space in the image. Is there a similar approach to identify things in say, rendered html... Is there an alternative to cv2 that can render and visualize html, like chromium?
Hi Nick, first thing to say, amazing video thank you so much, and when i do augmentation it just augment the images with no bounding box and discard the other why??
Hey Nick! Cool Tutorial as usual, but I'm facing a problem. When we capture an image , before the albumentations and augmentation. The image is not getting loaded. If I check whether actually there is anything inside img , it says frame is empty. The part is exactly at 55:15. Clarifications from anyone would be much appreciated!
Thank you for the video. I would like to know that can we apply the same code for multiple face detection???
Hi so if i want to make it so that we could use it for multiple people the loss would be different right ? Would be great to have something more recent as well
Hi Nicholas if i want to detect more than 1 faces what should i use?
Hey Nick, One question how will i zip the images and bboxes if i have more than one labels. Let's say i am training for cola cans and i have multiple cans in one image but they all belong to the same label. Would you please help me out??
Hello. Do you have the method add percent at bounding box showing?
Now I'll rule the world with this
Go getem Esmo!
Thanks for a great tutorial as always! I wish to know if this is implementable on a Windows machine with 16GB RAM and 4GB NVIDIA graphics card?
Thank you.
Thank you so much for this video it helped so much. So we only use augmented data to train, test and validate the model. The original images are not used. am I right?
Hi, nick, we already have a build_model method which returns a model, why do we need to build our own model class?
HI Nicholas. I am just wandering that is this the DeepFake Detection model using Deep Face Recognition? It will be great if you could clear my doubt and your work is amazing and I would like to do more research on this. Thanks!
Thank you Nicolas
Thanks a mil for checking it out!
awesome thank you !
Hey i trained this using photos of multiple people, how do i get it to tell who the face belongs to too ? i have kept the label separate for each of the people whose photos i have kept ,
Great Tutorial thanks , can I use it without GPU ?
Thank you sir. But can we use MTCNN on detecting the facial features instead of labelme?
Hi Nicholas
You are doing amazing work. And your channel is full of practical knowledge which is great. I have a question, can we use our normal pc to work on these projects or should it work on higher OS?
you can use calab, it's online ide from google
great tutorial..helped a lot..can u please help to do multiple face detection with the same architecture?
Hey, i am try to recreate your sign language detection. but I have error on update config for transfer learning text_format.merge(proto_str, pipeline_config). I am searching online but I can't clear this error please help me.
Omg, this is gonna be epic...
🙌🙌🙌
Hello Nicholas , Great video !! I have a question, suppose I have approximately 15k images in my dataset and I want to annotate them all in 'COCO Format' , is there anyway faster than annotating them manually ? And then exporting them as a single json file. I would appreciate your help. Thanks
There are auto annotation tools out there! I don't have any recommendations for any but there are a few that are pretty good!
in the override for train_step() shouldnt it be "self.opt.apply_gradients"?
CONGRATS!!!
i still dont get something.
in part 8.3 Build instance of Network
how do you pass the coordinates as input ? The input accepts only the image as I can understand.
where am i mistaken??
your tutorials are always great. Can you please add a code to convert it into tflite then imbed it in a flutter app? that will be great idea.
were you able to do this Hunar? I also think its a great idea
@@lindanidlamini4567 Were you able to do this Lindani? I also think its a great idea.
@@vamsik1453 were you able to this Vamsi? I also think its a great idea.
This could be a good option to create a facial recognition system or is it better to use algorithms that are already built?
Hey, i wanted to ask if you have any papers, regarding your information. I am currently trying to create some simple face detection for a subject at univ. and your tutorial is awesome.
YOU ARE THE BEST😃
Hey Nick, anytime I calculate the localization loss it returns an error saying operands could not be broadcast together with shapes (8,1,4) (8,2)
please how did you get the Jupyter notebook you used in the video
Do we really need to do those annotations of faces manually? I am confused.
nick what if i have dataset of different faces with different labels, how can i print those labels instead of just 'face'
Where did you get that plant with the lights though?
how is Learning rate decay calculated ? where did you get the numbers ?
I wonder is it possible to use ImageDataGenerator from TensorFlow Keras? and if possible how to deal with the coordinate 🤔
Hi Nick, you did not add the accuracy in the boundding box in the detection. Pls, how can I do that since I'm novice
Hi Nick,
First of all thanks for putting so much efforts, your content is really helpful.
I have a doubt, should we label blur images or not. Would blur images help the model classify better or would it make the model misunderstand the label.
Possibly! Could add it to the albumentation pipeline!
I'd suggest that this would not help for this dataset, since you now have less data, but more labels to train for. In general, you need a very large dataset for image recognition/object detection. 115 images is tiny dataset, 5000 images is still a very small dataset (ImageNet dataset is 1.2 million images, COCO dataset is 320k images).
Also since this a CNN based architecture, and assuming the blur is a gaussian/gamma distribution based blur, I'd suggest that blurring the images allows the can layers to learn a more generalisable kernel, resulting in higher accuracy on un-seen images.