Train YOLO v3 to detect custom objects (car licenseĀ plate)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone this is the fourth tutorial where I'll show you how to train you'll with three to detect gusta objects so I'll try to dictate a car license plate so in this story I'm going to explain to you an easy way to train your with three on turns four to how to detect a custom objects even if you are beginner or even if you have no experience code so first step is to prepare the image data set an image that it is folder containing a lot of images I suggest at least a few hundred of them or these images so where there is a custom object you want to tag as you can see that a part of images I am downloading from Google Image Search so this is one of examples where you can download your custom data set for example to do these steps it takes a lot of time so I recommend at first Google where you can download for example all these images without labels because I chose here a hard part how to get these images because as you can see it's quite takes a lot of time to drag all images or if you do save as and give always different name and to get old for example this data set for around 300 images would eat your time so it's much much simpler to search for these images for example google data set as i showed you in my previous tutorial also I would say that having these images is not enough we also need to specify where the custom objects are located on the specific image this means that we must label them so this is also know also one of the huge job which we must do before training so for this operation we'll need a external software I'll use that one of the most popular all label IMG you can use it for Windows Mac Linux it doesn't matter so let's see as you can see I opened the github repository of this open source software and there is full instructions how to install and and run this software on your own operation so first because I am on Linux I'll try to show you how to do this step by step so I owe I open a terminal and of course first what I need to do is download or clone this repository so I've all right git clone copy the link it might took a while because I have a quite fast internet for me it doesn't take a lot of time so I opened a label IMG folder and try to run it python label IMG but i didn't follow the instructions i need to make QT 5 pi/3 library so i write i make it and try to anita man again python bible IMG pie and as you can see it already open so first step i do i open a directory where is my images custom data set as you can see and now actually we are ready to label these images so first step you need to do you click on rectangular box here and oh I press the W and I'm I drag on my object right label for this object and save it I do this for second image third fourth and so on I will do so give me a moment to do these steps for you you so as you can see I chose a quite cool course from my repository and I drink the step-by-step course and I will do I'll label only ten images well actually all images I have yeah I think I have ten of them so at the end of these full operations in the sink folder we should see XML files for each image with the same name so what I'll do next so I didn't want to waste time labeling images just for this draw so I searched for already labeled image with the same external labels I found this cool dataset as you can see from Robert du Chien and I downloaded it and I'll quote I download it and I'll copy all images and labels through train and test files respectively so form as I said I have really fast internet here on my computer so it for me it is quite fast but for you this might take some time so so let's see how it looks this data set these are the images I will copy and here is bold Asian images and now what I'll do I'll try to copy all this to to make custom data set image so sorry I named the validation folder to test and of course I'll cut all of xml labels and cut cut all the images to one folder and of course all the least everything in test and of course I will do all everything the same for the Train folder and of course images cut copy paste and delete and everything so I have the here Tenley blurred images so I actually I could copy them but let's first check how our downloaded data set looks like as you can see here he he label at images from history be straighter of the cars and as you can see he'll have a lot of images actually he did a big good work and okay it's fine for me use this dataset for training so let's merge my data with string image data and that's it as you can see I already have prepared bind mall data set for training at least images and labels now I need to go to XML - Yolo v3 script I say told in my previous tutorial and I'll convert these labels to you all over three labels so so what you first need to do is right where it will be your where is your data so I'll write it as custom dataset and next right will where we'll save your txt files of class names license license plate train annotations and license plate test annotations so that's it and of course because I don't have subfolders here as in my previous tutorial I will need to write our fault and yeah let's earn this and as you can see dataset was quite short it finished doing these tasks and it generated our files here as you can see so you should we see the same files if you would like to train your custom model so that's it we already have a prepared data set for training what next we should do we need to change a config spy file so first what I'll do is I'll go to if everything is fine here so first what I will do I go to you with the folder I open my config start by folder file I mean and here I'll write the names of these paths so I need to train change training classes trainer date and path and test plantation path lines and of course I recommend to use train data augmentation as true and train transfer as true and if you don't know why just check my previous tutorial now we can try to run this Python train dot PI script and let's see what will receive let's little shortly it should start training well actually because I have a GPU it will be quite fast for me and as you can see it true generated only 55 training steps not that much and now model keeps training what you should do is just wait to finish for training I think I have 100 steps to train so it's not a problem for me let's wait for it to train it now of course we can check how our model is training so best way to do is check in on denser ball but I wouldn't want to show you how it training because it takes a lot of time so see you after it finished training I will open answer board and we'll see how it performs so see you later so we'll come back after a while and it seems it's finished training it to finish 499 steps and right now to check how our model was training best to check it on tensor board so I open another terminal and all right tensor board tense dr. equal to dog there's my answer board locks I copy the link and of course I'll open it on the browser so learning doesn't matter for us right now and as you can see here is the results of our trainer so here you can see all the graphs where you can see all the losses used in the training process and what I should say the most important is well dete loss as you can see and you might ask why is the most important and that's quite simple lower the value of ball did lost but the model is in this example my curve is to correct to be true but only because my digit is small and lock diversity so if you check my previous tutorial so that with large dataset it's quite different it's wiggling very much we're a lot and as you can see here value is the most important parameter here for us and see 76 and a probable 76 is best for us oh here is 75 and you can probably you saw on my priest or when course started Grove it again to to the up direction and this means that our model starts to overfit and it's it's getting worse every step so it's best to use our model which is on the lower step in the lowest step own volition loss so that's it you can see and actually how long it took it one how 27 minutes to train this model on my GPU and that's quite fast as you but that's the thing so right now I think you wait for this ok I'll close this window our custom model is say a bit in checkpoints here folder and s Yolo custom model to test this model I'll open the detection custom script this one and I changed the image back there spectively where which image I will try and for this dataset again I took two random images from Google and try to detect car license plate for them so actually we can test this and let's see what result we receive I'll build this simply so as you can see it detected God 666 as a license plate that's quite interesting license plate okay now let's try another one I got only two images but actually that's enough to make sure that my model is working and I'll add one license plate for this Ferrari car this is also quite beautiful car and as you can see this was quite simple how to train this model and how less steps I need the biggest job was to prepare data set for everything that's it and now for the end I should say that it was quite simple and short tutorial with detailed step-by-step explanations how to train cast an object actor even the beginners should be able to train custom detector following this my step by step shoulder actually we could expand this tutorial by extracting license plate number from detected objects but this is quite not the goal of this tutorial series maybe I'll come back to this task in the future but for now I'll move on because you are waiting for my next interesting tutorials with y'all many of you might face a problem that you don't have GPU on your computer and it takes a lot of time trained custom motor especially if you have a large custom data set so to solve this problem in the next part I will show you how to train this custom model on the cloud with free GPU actually free GPU I'm I'm telling to you for you for those who don't have actually strong GPU on your laptop for example so keep pulling me like this video and we'll see in a next tutorial see you later
Info
Channel: Python Lessons
Views: 38,636
Rating: undefined out of 5
Keywords: yolov3 tutorial, yolov3 custom object detection, yolov3 object detection, object detection tensorflow, object detection python, object detection using tensorflow, object tracking, yolo theory, yolo introduction, yolo v3 explained, yolo v3 theory introduction, Yolov3, yolov3 tutorial from scratch, custom Yolo v3 training, car license plate, detect car license plate, custom car detection, LabelImg, train custom model
Id: 1A8B5Yy4tps
Channel Id: undefined
Length: 16min 41sec (1001 seconds)
Published: Sun May 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.