Auto Image Annotation using Autodistill 😲🚀 | Computer Vision

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to my YouTube channel my name is B ahed and I'm your host so guys in this video I have came up with one amazing tool called Auto distill so guys what is auto distill I will tell you but before that let me tell you some of the things actually so uh I think you already know if you are working in the field of computer vision uh so there actually data annotation is like very uh costly task okay I think we already know that because it takes manual effort right let's say we're working uh in a projects which is nothing but one object detection projects so before uh starting with the project implementation first of all you need to prepare the data okay and data preparation wise what you need to do you need to annotate those image okay with the help of this bounding box annotation for this actually what we use we use different different U actually open source tool or let's say PID tool let's say we have label mg tool so in my YouTube channel I already covered like how to do object detection okay and how to perform these kinds of bounding box annotation everything I have already covered if you go with my playlist okay see guys these are the playlist available so guys here if you check out this uh yellow V eight object detection and segmentation training so there actually I already showed you like how we can annotate these are the images uh not only uh yellow V8 I have already covered yellow V6 yellow V7 as well as yellow V5 okay so everything is available just go ahead and watch that particular video okay you will get the entire idea so there actually I think you already observed okay so whenever we are performing these kinds of bounding box annotation okay so we are doing it manually so we are picking up the image okay one by one and we are trying to annotate each and every object present in the image okay I I need to train okay for my model so it takes actually lots of time even it takes actually lots of effort okay even for this actually you have to also hire someone to do The annotation because let's say you have a huge amount of data okay in that case actually it it's not possible to annotate all the data by yourself okay so for this what you will do you will hire someone okay you will hire uh two to three people to The annotation then you will complete that particular task okay so guys here uh what will happen actually uh you also need to to pay some money okay to them otherwise uh why they will be working okay with your projects okay so definitely it needs cost it needs time okay it needs lots of manual effort but can we automate this task can we automate this kinds of annotation like you can say process let's say I'll give my image and I will use some of the tool okay and uh that tool will automatically do The annotation of my data and it will prepare the data and I can directly use that data to train my model can we do it just try to imagine whether we can do it or not okay so definitely we can do it and this is the tool actually roof flow team has developed called uh called autod distill so uh what is this Auto dis so here if you see this is the auto dis Auto dis is uh uses bigger and slower Foundation model to train small faster supervised model using Auto dis you can go from unlabeled images to inference on a custom model running with no human intervention in between okay so here if you see let's say you have some of the images so what you can do actually you can use autod distill uh tool and this autodist still uh uses some of the model OKAY some of the pre-end model that model already knows about your data let's say you are using uh something called car data set okay so that model is already trained with car data set that model knows like how this car looks like so it will automatically do The annotation for you okay that particular object and it will prepare the data okay uh the format actually want let's say I want like let's say yellow V8 okay uh I I want YOLO V8 framework to train my particular model okay definitely it will prepare the data with respect to that only but if you saw like most of the YOLO model actually uses same format of the data uh if you're using yolow V7 yolow V8 you will see uh data format would be same okay The annotation file you'll be getting uh which is nothing but txt file okay that is called actually YOLO annotation format okay that thing I already covered in my YouTube video just try to uh watch that particular video you will get the entire idea now you can directly use that particular data okay uh from your auto dis and you can U ready to train any kinds of edge ready model model okay so that is the actually task this autod distill actually do and this is one of the amazing tool actually they have developed this Robo team has developed and this is the example they have given okay as you can see uh this is the video okay running and some bottle is coming so it is detecting this is the bottle okay and they have trained this particular image okay with no annotation okay any kinds of manual annotation they they didn't do they directly pick up the images or let's say they directly pick up the videos collected the images from the video they uh given that particular images to the autod distill tool autod dis automatically has annotated the data and they have train the YOLO V8 model here okay so so they have given all the description about this autod distill Library like how it works okay and how to install and everything so you can go ahead and try to read this particular uh GitHub GitHub read me file so you will get the entire understanding see all the um I I think description they have given and how this model works and everything they have given okay so uh in this video I will uh focus on on the Practical implementation like how we can use this Auto distill uh tool how we can install it and how we can do the like you can say Auto annotation okay that would be fun and if you want to read this so you can go ahead and read this particular GitHub okay and see all the steps has been also given okay now guys what I will do I will just quickly uh uh I'll just quickly what I will do I'll just quickly uh create a collab notebook and there actually I will show you one demo like how this tool will work okay and how to install it and everything so for this what I will do I'll just open my collab notebooks so let me open my collab uh so this is the collab notebook let me Zoom this screen a little bit okay now I'll just name uh name this notebook so I I can give U Auto annotation Auto uh image annotation using this Auto distill okay Auto dist fine now what I will do I'll just quickly connect connect my uh GPU here so change run type type you can take any kinds of GPU I'll be going with T4 GPU and make sure you are selecting higher Ram if you're using Pro collapse so you can get this option higher Ram but it is completely fine if you're getting the default also now I'll save and I'll will connect the notebook so my notebook is connected now uh if you want to check whether you got any GPU or not you can execute this particular command Nvidia SMI so it will show you uh the instance actually you got so here I got Tesla T4 GPU okay it's completely fine now the first thing what I need to do guys I need to install um here I need to install auto distill uh Library okay so install uh Auto distill so uh to install auto dis actually you can refer this particular GitHub so I already prepared the command for you so uh with auto dis you also need to install some of the uh extra packages okay just for the dependency so this is the command guys you can execute see so guys as you can see this is the command to install this Auto dis and these are some uh like you can say required packages you also need to install okay now let me uh quickly install this autod disal package on my uh Google collab you can also install this thing on your local machine it is completely fine okay all right it is done now what I will do guys I will just try to uh check my current working directory uh because uh what will happen actually so whenever let's say I'm um saving my data or let's say I'm uploading my data it should present inside my current directory okay okay so for this what you can do you can use one package uh called operating system W okay just try to import W and if you want to check uh which directory you are in currently so you can write this particular command so w do get uh CWD that means current working directory okay CWD now if I execute this particular command so it will show you uh see I'm inside content that means I'm inside this particular directory okay now what I will do I'll just save this particular directory uh to a very variable called home and I think now I can print the home here okay now going forward whatever things actually I'll be downloading or whatever things I will be uploading I'll be uh uploading inside my home directory only okay so that's why I uh already defined my uh home okay home directory uh inside this variable okay got it now uh we can uh start preparing our image so for this I need some of the images okay so here I can write image data preparation image data preparation okay so for this first of all let me create One Directory here so I can create a directory with the help of this command um I'll just write mkdr and it should create inside my home okay that means inside my current working directory okay and I'll be creating a directory name image images okay so this is the name I'll be creating the directory now let me create the directory so my directory is created now if I refresh see this is the directory I have created now see guys here what you can do uh you can uh if you have some existing data let's say if you have some existing image so what you can do you can directly upload the image here okay you can directly upload the image here so what you can do uh first of all make sure you have U zip that particular file after doing the Z zip operation you can upload it so just right click and upload that particular zip file and later on you can unzip that particular file here okay but uh as of now I don't have any image in my uh local machine so what I will do I'll just quickly download one particular image from the rlow Okay so rlow so if I uh show you roof flow.com so make sure you have one account uh inside roof flow if you don't have account you just try to register okay so it will create one free account for you after that just try to sign in with your account okay uh make sure this account is required if you are downloading any kinds of data set or anything from the rlow this account is required okay with the help of this account you would be able to do it and I can use uh some python script to download that particular file I don't need to manually download it okay so this is the advantage to use roof flow so that is why make sure you have one account so just try to create one account so here I already have one project so if you don't have any projects so you can create a projects okay now here you will get something called Universe just go to the universe and inside Universe you will get different different data set okay see different different data set even you can search let's say I want something called uh object detection okay so here I can search for object detection data object detection data so if you search to Universe see you will get different different object detection data okay so from the universe itself I'm going to use one particular uh data set called trash data set okay let me show you so this is the data set guys I'll be using so uh this is the trash annotation data set so as you can see these are some trash like bottle then chips packets any kinds of let's say trash would be present inside the image and they have already annoted this data set okay but I don't need The annotation file I only need the image here because after downloading the image I will be using autod distal to annotate that data okay so that is my task because I don't have local images in my local machine that is why I'll be using rlow images here okay now see guys these are the images present inside this particular uh data set okay see different different uh different different trash and uh that that's why they call it as trash data so I will be using this particular image now if you want to uh download this particular data so what you can do uh you can use this particular code snippit so roof flow has already given this particular code snippit so see guys this is the code snippit you need to execute first of all you need to uh import roof flow okay you need to import Ro flow then after that you need to logging with the roof flow okay whenever you will be logging it will ask for one uh token okay that token I'll be telling you like how to collect that particular token then you need to mention the data set okay rlow download data set now inside that you need to mention the data set URL okay see I have mentioned the URL now what is the URL if I go back see guys this is the URL now if you go to any kinds of data and let's say I will be picking up this particular data okay now let's say this data now if you click on The View P projects okay so you will get the data link okay so just copy the link and try to paste it there so this is the data link in this case okay this is the data link um here I have just pasted as you can see this is the link I have pasted data URL and after that you can specify the format which format you want to download the data so here I have mentioned YOLO V8 because uh because previously I was training this particular uh data with the help of this YOLO V uh V8 model okay that's why I was uh downloading this particular format and how to train YOLO V8 for this I already created one particular YouTube video you can refer it now this is the code guys you you can use to download the data now let me execute and show you how it will download the data now see it is asking for the authentication token now here this is the link just try to open this link and make sure you have sign up okay you have sign up with the roof flow and you should have one account otherwise you won't be getting this token now here you can select your workpace so bu is my workpace I already told you there I created workpace now I'll just generate the token now guys this is the token so this is a onetime token only just try to copy and after that just try to paste inside this particular box and press enter okay so if you do it automatically it will load your workpace load your projects and it will download this particular data from this URL and it will save here okay so guys uh it will take couple of minutes I'll be waiting once it is done I will come back so guys as you can see my data has been downloaded now see guys this is the folder uh trash annotation data inside that I have test uh folder inside test folder I have testing image as you can see let me show you some of the image so let's say this is the image okay these are the trash and here I also have bottle let me show you I also have bottle here so see these are the can I think I also have bottle here and with respect to that I have also the uh label that means The annotation see this is the um uh yellow annotation okay txt annotation now I have also training then I have also validation now if I open the validation image also so see guys inside that I have see bottle and everything so now what I will do guys I will uh use one particular image folder here see I have three different folder train valid and test but see if you have only one image folder okay in your local you can directly upload here I will what I will do I'll just only copy this particular image folder okay and I will delete everything rest of the thing I will delete because I only need this particular image okay just to show you let's say I have these are the image okay I have these are the image now how to perform Auto annotation on top of it okay so for this what I will do I'll just move this particular image folder inside my image folder okay the image folder I have created now for this I need to execute one particular command so I already prepared the command so guys this is the command so I'm using MB command MB is a move command okay inside Linux now here I'm telling uh inside this particular folder okay as you can see inside this particular folder inside validation I have images okay I have images so all the images I want to move inside this images folder I created okay so this is the command I'm writing and why I'm taking the validation image because because if you see inside training image it it is having like lots of images okay and it will take lots of time uh because again it's a it is using pre-end model okay it is using some bigger pre-end model this Auto distill and it is like very slow okay because it will do the automatic annotation so it it is very slow they have already mentioned inside their GitHub as you can see so that is why I'll be picking up less amount of data and so that I can quickly show you in this video okay that's why I'll be using validation data but if you are having lots of data so you need to wait for some time okay uh because I'll I'll show you the progress of this annotation now I just want to uh move this particular image inside my image folder I created here so let me just execute the command and let me show you what will happen see guys it is done now if I refresh now let me minimize and if I go to my image folder right now see all the image has been copied from my validation itself okay see only image I have okay so here I haven't taken the level I have only took the image here okay in this particular folder see all the image in jpz format so guys my data uh image is ready now I can apply this autod distill uh tool on top of it and let's see like how it uh do The annotation so now I will apply Auto auto Lael data set okay now that means I will be using Auto dist to label the data set now let me first of all check my current breaking directory so I'm inside uh content only okay now here this is the code snippit from the auto distill if you if you visit their GitHub they have already given the code s and everything you can refer that documentation but I have already prepared one notebook so that's why I'm um explained directly now see guys from Auto distill itself uh here I want the detection okay you can also perform segmentation like annotation also it is also possible here you need to call segmentation in that case okay now here if you see here uh autod distill detection and here I'm importing something called caption um onology okay caption onology so what is this caption onology because they are using some large language model OKAY from the NLP itself and with help of this large language model they're trying to understand the prompt okay let's say this is the prompt I have given so here I'm telling inside the image okay I have bottle okay I have bottle see you have different different object here let's say you have plastic uh bags you have these uh these are the I think I don't know what is this object called but if you know that particular object name so you can mention inside this caption okay so in this case I only Define the bottle I only want to annotate the bottle inside my image as you can see I have bottle okay let's say you have some other chips packet you can also Define chips packet okay that model also know like what how this chip packet look like so that's how we can give an an of prompt okay you should know the prompt if you want to learn the prompt uh engineering here so you can visit this uh GitHub you will able to understand so here I I'm telling whatever bottle I have inside my image try to annotate with the trash because I want to Define that particular object as trash because I'm doing trash detection here okay so this is the caption I have given now let me execute now here I just need need to Define my output data set directory so whatever annotation it will do it will save inside this data set folder okay now let me uh Define now I also need to mention my image directory so this is the image directory inside that I have all the image okay then finally I can start my uh Auto annotation so this is the code snippit unit to see uh just uh like very less line of code you are you can do this kinds of Auto annotation you don't need any manual effort okay uh day by day you don't need to do The annotation manually so just now have some coffee and wait okay and you will see uh and after that you will see uh it will annotate your data and it will prepare all the folder okay with respect to your requirement now here uh you need to call this uh ground s and inside ground s you need to mention the anology you have defined so this is the anology you have defined I want to uh annoted this bottle as trash now here you need to Define this object and here you need to mention the format of the uh image file as you can see I have jpg format if you have PNG format you need to mention PNG format here so in this case I'm having jpg so that's why I have given jpg now this is the directory you have given like inside this directory I have my image and inside this directory I want to save my data okay now let me execute see if I execute first of all it will download all the required model okay see it will download all the weights of the model see it is using bbased uh C model for the understanding the prompts uh if you know BB uh C model is a NLP model natural language like model and it is available on the hugging face okay so that with the help of this model they are understanding The Prompt okay and they're using some U computer vision model to do The annotation because that model already knows like how this bottle look like how this chips packet look like okay because they have already trained with huge amount of data that is why now see guys it has started The annotation now I have 299 image okay in this particular folder and now five is going on okay now it is annotating number six image now 167 is image is doing that's how it will take some time because this is a little bit slower approach because they're using some model and all in the back end and that's why you need to wait now guys let's have some coffee and once it is done um I will come back and I will show you uh how this output will look like uh so guys as you can see my um labeling is done and here I got my uh output so let me show you inside the data set folder now see guys uh successfully I got my um training set and said training I have my image just ignore this two folder this two folder is not required this annotation an image you need to look at this training and validation uh label inside label actually you can see I have my annotation see it has already annotated now uh that's actually I can't uh see like whether it has done that correctly or not so for this U I will show you like how to visualize them and see guys I also got my data. EML file okay and there is only one level which is nothing but trash uh perfect guys even it has also saved my location of the training image and validation image perfect now see guys now using this uh image actually so you can delete this two file and using this image actually you can easily train any kind of yellow V8 model or yellow V7 model it's up to you okay see guys uh we have successfully done The annotation now let me show you whether my annotation is correct or not so for this um um they have already shared one particular visualization code so here I can write display the sample so for this first of all I will be defining uh these are the variable like my um data set label directory image directory and data. EML directory okay now this is the code snippit they have already shared and they're using something called supervision okay I already discussed what is supervision rlow Supervision in my um previous video let me show you so here I already created one video on the supervision okay so supervision is a utility Library it has all the actually functionality uh you can use what whatever code actually you need to write repeatedly okay before that first of all I want to check how many data set I have so here I am having to uh 239 uh because why 239 because some of the image has been uh removed because I think there uh no bottle was there okay that's that I think that that's why they have removed this particular image now finally let me visualize for this I will be defining my grid size and all and after that this is the code snippit guys uh so this code actually will get from uh their GitHub okay their GitHub so they have already shared like how to visualize the image so they're using again supervision library to visualize the image so they're picking up one by one image from this particular folder and they are also mapping this uh label okay label uh you have generated now if I execute now see uh you will able to see all the label so guys as you can see uh yeah so here is The annotation guys as you can see trash trash trash uh trash okay some of the image doesn't have any bottle I I think it it is not visible that's why it hasn't annotated but uh see mostly I'm able to do The annotation okay it's great guys now you can use any kinds of data set um to do The annotation okay with the help of this Auto dis you don't need to manually uh do The annotation you can uh use this uh particular tool and you can directly uh do the auto labeling okay so yes guys this is one amazing tool now see you have your data now you can use any kinds of yellow model and you can drain the data on top of it okay it's up to you so yes guys this is all about from this particular video I hope you like this particular video and you can let me know how is this tool and all about okay and try to uh do the experiment with your own data and you can let me know okay in the comment so yes guys this is all about from this particular video uh just try to subscribe to my channel and try to share this video with your friends and family thank you so much guys for watching this video and I will see you next time
Info
Channel: DSwithBappy
Views: 1,932
Rating: undefined out of 5
Keywords: AutoImageAnnotation, Autodistill, ArtificialIntelligence, ImageAnnotationTools, MLWorkflow, ComputerVision, TechInnovation, AutodistillTutorial, AutomationInAI, DeepLearning, ImageRecognition, TechAdvancements, EfficientAnnotation, DataLabeling, roboflow, roboflow autodistill, autodistill, auto image annotation using autodistill, auto data annotation using autodistill
Id: brgQFDe5wRs
Channel Id: undefined
Length: 23min 47sec (1427 seconds)
Published: Fri Feb 02 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.