How To Label Objects For Object Detection - Generating Dataset for Neural Networks

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to the video on this new networks and deep learning tutorial in this video here we're going to generate a data set and then we're going to annotate it later on as well so we're going to use opensv to act like omapa webcam store some images or like save some images for our dataset and then we're going to do annotation or labeling with roboflow so we're going to like annotate and label all the bounding boxes of the objects that we actually want to maybe like train the model on later on but first of all runs on discord server i'll link to the description here you can join the channel shadows about computer vision deep learning ai and so on you can also become a member of the channel if you want to support channel with a small monthly fee everything will go to create more and better quality content here on the channel also if you have some problems in your own projects and so on i can also give you some guidance and help with your projects if you're a member of the channel so thank you guys so now we're jump straight into visual studio code here and i'm going to show you the script that we're actually going to use to generate our data set so everything will be down in my in my github link down in the description you can just take that copy it and make your own data set and label it and then you can create your own naval networks later on but here we're going to import opencv we're just going to open up our webcam capture here then we're just going to have our webcam running like a capture here running as long as the webcam is open then we're just going to read in the images from our webcam one by one then we're going to check if we hit a key if we just hit escape on the keyboard we will terminate our program and then we will end the date data generation process if we hit s on our keyboard it will then save uh save the image that is currently shown or like written from our webcam and then it will store in this dataset path here that we specified inside this in write function then when we actually just terminate our program we'll just release our webcam and destroy all the windows that we've opened up with omsv so this is basically a really simple script we're just going to run it here so you can see what is act like going on so here we will just have a webcam we're just going to open up my webcam here and then we can just take a couple of images then i'll load upload them to of roboflow i'll show you how we can actually like annotate images with different kind of objects so here we're just going to annotate some different kind of optics i'll just take out my keys here um here and we can then hit s now we have actually saved an image we can also see over here to the left that in the dataset folder we now have this zero dot png image then we're just going to take a couple of images here then we can then later annotate them in roboflow and i'm going to show you how to do it here we're just going to take a couple of images just somewhere here without the keys so we can actually label the lamp here maybe the table here some cops and also the tv here in the background so now we just have a couple of images if you want to create your own data set and so on you should actually like generate more images but you can even train like a yellow v5 model with only like 50 50 to 100 images of some optics that you want to do update detection on so right here we're doing specific optic detection of of of constant objects that we choose in our environment we just need to generate a data set label the data set with all the different kind of boundary boxes of all the objects that we want to detect and then we're just going to train a yolo model on it for example for doing update detection i've already a video about that how we can actually train your own custom optic detector here and channel so make sure to check that out if you want to know how you can train a yolo v5 model with your own data set to do custom optic detection on optics that you choose by by yourself so here we're just going to terminate our program and then we have a data set over here to the left we see all the images here that we're now going to load into roboflow so now we're jumping into the robo website here you can just go to like robovlo website sign in with your github email or something like that and then you can actually go in here create your own projects um and so on you can just go with the public version uh for your own like a private like for your own personal projects and so on so here we're just going to choose a project name we're just going to call it like optics we have to have these keys so we're just going to keep calling keys we're just going to add other labels too then we can choose the license here we're just going by this default one here the plot public domain license update detection we want to do updation with bounding boxes so we want to detect specific optics inside of our image and not only classification we can also choose clarification if we just want to classify this image or like this is is this a cat or this is dark we don't want to like uh find where exactly is the dog or the object in the image but in this video here we want to do object detection down here we have some other annotation letters up here we're just going to call it objects and then down here for the letters this is just one annotation group that we're going to do and we want to do keys here for one of the objects in our actual images that we want to label so here we can just create this public project and then we'll get up here then we can actually just drag and drop our images from the folder that we just created into this uh into roboflow here we will upload the images and then we can then do annotations uh with it with their tool then we can actually just select the files that we want to annotate then we're going to here we go you just find it within the desktop and then into data and then we have the data set data set here then we can just take all the images here and open it up and then we'll actually just upload these images you can upload up to ten thousand images in the public uh public public version of roboflow here so it's actually a really good tool to do annotation it's also really easy and when we're going to use it later on and export our data set it's also only like three lines of code that we need to import into our python code when we're going to train our models so here we can see that we have all these things here we can just say finish uploading then it's just uploading files here zero seconds remaining now we start uploading all the files and just verifying it here we can see the total number of labels that we have or like total images to label we can see some different kind of teammates you can add like colleagues to the projects here as well and so on but now we have a batch name here uploaded and then we can assign the images so here we're just going to assign it to to me we're just going to assign the images so we can actually assign images to different kind of persons so here we have nine and un annotated uh images here so we can actually just click on one of them and then we get up this annotation tool here we can actually go down here to label assist where we can actually like have a model running like we could for example have a cocoa mole model running or like a model trained on a coca data set so we can do automatic labeling with a model um with a model you can even choose your custom model if you want to do auto labeling of your own data set here we can just try to decode model and see if we can actually find something inside of our images or else we will just go in label it um our by ourselves here so we can actually see how that is done too right now it might take a few seconds a few moments here as it says here we're just going to say 80 classes so we can see what connect like find in the images we see it found a person that's really good we can go to the next image here it found a cup so over here to the left we can see the cup that i detected the next image it didn't find anything here it fine it found a person and a cup a cup a cup and a person again and then it found a person here but with like a larger boundary box then we can actually go in here so now we have these labeled images here automatically we could also go in here and label them by itself if we want to for example detect this as a face then we can just go in here annotate draw the bounding box then we get up this tab we can just call this face and then when we hit save here or we can just hit enter then we will actually label this bounding box here as a face all the information about like where is the bounding box in the image and so on it will be stored in the correct files and then later on we can actually just export those files train them together with our data set but real load does all this for us we just need to call a few lines of code when we act like going to train our model we can also take the lamp here for example we're just going to draw a boundary box around it we're just calling it going to call it lamp over here to the right we have a tv we're just going to label that as well so we have a tv and then we have the cops down here at the bottom but now you can see you can just label an arbitrary number of optics in your own images here this is really nice it's really cool and you can even see like it's like like really fast you can do like the label assistant and so on repeat the previous ones and so on you can move around the bounding boxes after they act like defined so we can actually specify a shorter is like a smaller range here for a person and so on we can change all the bounding boxes so this is a really nice tool and you should definitely use this here if you have your if you want to create your own custom model that takes an algorithm or like a new network to do custom update text and uh for example keys and so on here we can just take the keys label them just right keys over here to the left we can see all the groups that is act like in the image and also unused classes so here again we can just go to the next image label it this is keys again here we can see all the different kind of optics that that we actually have in our data set so again we're just going to save it and then when we're done actually annotating our images we can just go back here to this to the start and then we can just go up here add to data set we can specify like how much do we want to use for training validation and test in this video here we're just going to go with 90 train 10 uh validation or like 80 uh training 10 validation and 10 test we're just going to add the images to our data set so this is one collaboration from one and then we're just going to generate a new version up here with our data set we can do some pre-processing techniques we can do augmentation on the images here as well we don't have to do anything we just need to upload images annotate them and then we can just use these techniques here from verbal flow this is really nice and it's just really convenient when you're creating your own custom optic model so here we can resize that we can specify the dimensions that we want to resize our models for we can add an additional pre-processing step we can create scale images we can isolate optics static cropping and so on but down here we don't want to do any pre-building steps in this video here so we can just go down to augmentation we can do flip we can do horizontal and vertical flip off our images so we can actually get more images in our data set with more variation so our models would act like be more robust to do uptake detection or like custom optic detection we can also have crop rotations here here we can crop the image we can specify how much do we want to crop the image so we get more variation some zoom effect in our image too so we're making our model robust to zoom effects we're gonna add some other different gun things shearing rotation so how much do we want to rotate our image if we think that our object will be rotated around in the image frame it could it could actually help the model by applying some rotation to in the augmentation but here we can then hit continue we can go down generate our data set so here for the public version we can generate up to three times the images that we uploaded and then it will do augmentation for um for like two-thirds of the image data set that we have so then we can just go down hit generate and it will generate a new version here of roboflow or like for a data set and then after now we have all the images we can see that the data augmentation is act like applied on these images and it still has the bounding boxes um in this image here with the with the actually annotated or like augmentated images as well so it both has augmentation and annotation and here we can just go through our data set here with our 28 images so this was just our test set here so now when we're done here we can actually just go up here and either we can hit more we can rename or delete a version or we can actually just go into export we can download our whole data set here as a zip file to our computer or we can just show some downloadable code here so we can actually just pass this line of code into our python script and run it and then we can just train our model so first of all we need to choose a format depending on which model do you want to train if you want to generate you'll define model you'll just choose this text format here you'll be five pythord or if you want to do it in in carriers or something like that you need to choose the other different kind of formats also we can use the pascal voc so this is basically just how it's how it's defining the bounding boxes and the labels in a specific file so this will just be a text file containing all the information about the class and also the coordinates of the bounding box that you have annotated in the image so you can then use that for supervised learning when it's actually trained in the neural networks so here we're just going to go with the old v5 then we're going to show the downloadable code we hit continue it's saving the files and exporting them and then we can see these lines of code is the only thing that we need to act like add to our notebook if we have all that installed roboflow on a local machine then we just need to import these four lines of code then you can actually just copy these four lines of code here and then when you're training your custom yoli 5 model update detector you can just go inside the dataset here pass this dataset variable and these different of pass in path inside of this one here to the ov5 model and then you're just going to train it so this is a really nice way to to generate images uh annotate them here in roboflow it's really nice it's really cool and it's actually really easy and fast to do like we can generate a data set in 5-10 minutes with the images and then we can do annotation depending on how many uh optics that you want to to to actually detect in the image but it's really fast it's really cool and the tools are really nice and also if you want to do some auto labeling it also has that feature so thank you guys for watching this video here and rinse the subscribe button and notification under the video and also like this video here if you like the content and more more in the future it just will help me and the youtube channel out in a massive way i'm currently doing this computer racing tutorial where we're talking about basic image operations camera calibration stereo vision to get depth information in in the image how we can convert act like stereo vision and depth images to point clouds do point cloud processing and stuff like that so if you're interested in that tutorial i'll link to it up here or else i'm not seeing you next week guys bye for now
Info
Channel: Nicolai Nielsen
Views: 4,565
Rating: undefined out of 5
Keywords: yolov5, yolov5 neural network, yolov5 custom object detection, yolov5 object detection, yolov5 tutorial, object detection yolo, object detection pytorch, object detection python, opencv object detection, opencv yolov5, opencv python yolov5, object detector, object detection yolov5, opencv, yolov5 dataset, neural networks, detect objects with yolov5, opencv dnn, opencv neural networks, roboflow, data labeling object detection, object annotation, yolov5 annotation
Id: _oFRHPjygkI
Channel Id: undefined
Length: 13min 57sec (837 seconds)
Published: Sun Feb 06 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.