Annotate Data with a Few Clicks using (SAM) Segment Anything Model in Roboflow

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to my YouTube channel my name is B ahammed and I'm your host so guys I have came up with another amazing video so in this video I'm going to uh show you one amazing research actually from meta called uh segment anything or you can also call it as Sam model okay so what is this Sam model exactly so here they have already written segment anything model that means Sam a new AI model from meta AI that can uh cut out any object in a image with a single click okay so what does it mean actually I will show you as a practical I think that would be very much clear but uh first of all I just wanted to tell you uh something actually uh I think you have already worked with image segmentation task inside computer vision so whenever you are working with these kinds of image segmentation task so the first thing actually we need to prepare the data right and uh for preparation of the data what I need to do I just need to do The annotation of the data and uh for this actually what we perform we perform something called masking annotation okay we'll be doing something called polygon annotation I think you have seen like what is polygon annotation if you don't know how to do image segmentation so you can go ahead with my YouTube channel and here actually I already created uh some of the video regarding this uh image segmentation as you can see uh image segmentation with the help of OV V8 okay so there actually I already showed you how to perform annotation and all so you can check out that particular video I think uh this part would be very much Clear okay so make sure you are watching that video then after that you can come here if you don't know about segmentation what is segmentation exactly just go ahead and watch that particular video okay so uh there actually uh you saw like we have to do The annotation of those data okay Manu we just we just need to create that polygon boxes manually what is polygon boxes it is more than uh Four Points okay we call it as polygon boxes whenever we used to do object detection so what we used to do we used to perform something called bounding box annotation okay and inside bounding box annotation we just need to create a box okay we we need to create a box but whenever we are considering this uh masking okay so there actually you need to create the polygon points okay with the help of this polygon points actually you can do the masking okay I think you have used something called Photoshop so in Photoshop I think you use something called lasso tool so so guys let me show you the lasso tool so here I can write lasso tool Photoshop okay so here you will see the example actually see guys this is the ler tool now uh let me give you one example like how this ler tool Works let's say uh yeah this example I can take let's say you want to actually select this particular cow okay from this image actually so what you need to do you can select this lasso tool and manually you just need to uh carefully select this particular object okay and you will see it will take lots of time right because you need to create small small points and you need to connect them and uh at the end actually you can select that particular object okay the same way we can perform these kinds of masking annotation okay we have some tools actually let me show you so uh we have something called label okay lab label uh me okay so there is a tool called label me so with the help of this label me actually you can do this kinds of polygon annotation let me show you so let me open the label Me official GitHub label me GitHub so first of all let me show you what is the difficulty level actually face usually during data annotation uh then actually I can uh show you okay why you should use this Sam model so here uh guys if you see this is the official uh like GitHub of this label me okay and this is the label uh label me AI from this organization they have released this particular tool and here if you see guys you can do something called polygon annotation okay so here you have different different objects so here you can select that particular object uh but for this actually you just need to set up this particular tool so let me set up this particular tool so I'll open my I'll open my folder so here I already collected some of the image for you so this is the crack image actually if you see so here is the actually wall and these are the crack actually on the wall okay as you can see these are the crack okay so now see why I have taken this crack actually image because I want to show you because let's say you want to do like a a crack segmentation so it will segment out this particular crack from this world okay so definitely first of all you just need to do the masking annotation here and I will show you what is the difficulty you will face whenever you will be doing this kinds of annotation okay uh if you're using this kinds of label me or any other let's say annotation tool okay but after that I will show you with the help of the Sam model and you will see it would be very easy for you only just one click you can do the entire annotation okay so this is the like uh comparison I just wanted to show you because uh if you're working in a field of computer Visions so definitely data an notation would be like very headache task so that's why so that's why I'm exploring these are the tool and I'm creating a video on top of it so that uh you can get to know okay these are the tools are available and it will uh make our task very easy okay so these are the image actually I downloaded uh I just only downloaded I think four images okay but you should have let's say like very uh huge use amount of image here whenever you are trying to do any kinds of projects but just for the demo I just kept four Images here okay now what what I will do here I will open up my terminal and make sure you have created one virtual environment so I already have virtual environment so I'll just use that particular environment so I'll just write K uh first of all let me see K EnV uh list okay how many environment I'm having here now guys here if you see I am having different different environments so I'll be just picking up one environment from here so I'll just write cond activate Okay let's take this one summary this one I think I created so this environment I'll be taking okay now after that you just need to set up this particular lbel uh me tool there and to set up it actually they have already given the command and everything so see they're telling first of all create an environment then activate it then you just need to execute this particular command Okay PE install label me so let me install it uh so guys as you can see my uh installation is done now what I will do uh I'll just try to see the command actually to open this particular uh this label me so they have already given the command so you just need to uh execute label me from the terminal Okay so let me open up my uh folder and here is my terminal so here I'll just write label okay label me so this is the command you just need to execute so if you uh execute this particular command so it will open up uh your label me actually here so let me show you so it will open up one UI for you and this is the UI look like okay so this is the UI look like now here what you need to do first of all you just need to open your data directory okay so let me just click here and I have my data inside this C rack image okay so I'll open this particular directory once you open this particular directory you will see it will automatically load the image for you okay so now uh here what you need to do you just need to perform this polygon annotation okay before training the model definitely you just need to annotate the data as you did in your object detection but object detection you just need to create a bounding box okay and it's like very easy to create a bounding box but whenever but uh whenever I'm talking about polygon so definitely it would be very much difficult for you so see to create the polygon just select this particular create polygon like uh tool here now after clicking on this polygon okay create polygon you will see uh this is the actually interface you will get and it looks like okay your ler tool now just zoom this image okay so if you just uh rotate your wheel so it will Zoom the image and you can uh see the image okay carefully now here you just need to start The annotation see now just create a point uh again create a point again a create Point okay now the smaller step you will be taking the more perfect your an would be see okay so that's how you need to complete for all the uh crack you can see on this image okay and it's like very time taking okay see guys it's very time taking so you just need to do the manual observation and carefully you just need to segment this particular uh crack okay from this well now once it is done you can also go up again you can start so let me do do it quickly because I just wanted to only show you but whenever you are doing your annotation make sure you are doing it perfectly okay otherwise uh you won't be getting good performance from the model so always make sure uh the more good you will be doing the data notation the more good performance you will be getting from your model okay so see guys uh here uh I'm just doing the masking okay that means I'm creating the polygon here uh on top on top of my uh object I want to segment see once it is done I'll just add this particular point and here it is asking for the label Okay so here I can assign it as this is a crack okay this is a crack and okay so once it is done see it is completed now this is for one image now you can again go to the next image okay so first of all you need to save it so let me save so once you can save so inside crack actually it will save then you you can go to the next image okay then again you can select this particular create polygon again you can start uh like doing The annotation see that's how actually let's say you have thousand image okay now just consider how much time actually it will take okay so how much time it will take from you actually to annotate the data so definitely you should you should have a bigger team actually to complete that particular thousand image okay this is not possible for one person so that's why it's like very uh hard task okay in uh image segmentation IM segmentation task inside computer vision so that's why actually this research actually came okay this research actually came so they created one uh amazing model called uh segment anything model and you can also call it a Sam and it can cut out any object from any image okay so as you can see they're telling Sam is a prompt table segmentation okay system with zero short generalization to unfamiliar objects and image without uh the needs for the additional training so you don't even need to perform additional training of this model it can almost segment out any kinds of object okay from any kinds of image okay so I'll show you I'll show you the demo so here they have given different different demo as you can see you can click on the demo and you can check out like they have given different different demo uh and you can uh try it out but the easiest demo actually I will show you with the help of roof flow okay so roof flow actually recently collaborated with this particular Sam okay so um so Robo flow developer team what they did actually they actually worked on this like Sam model and they actually integrated this Sam model uh with their roof flow actually uh this platform okay so let me show you how to use this so first of all try to sign in okay try to sign in with your roof flow account um I think I already created some of the video like how to use and all okay different different like actually tools you can use from the Overflow and it's amazing okay if you're working in the field of computer vision so it's amazing actually platform you can use okay done now I'll again create a new project just make sure you are naming this project so I'll just give trck crack uh segmentation uh select instance segmentation and here you can give The annotation group so it's crack and create a project so once you created the project now you need to upload the data so I have already my data here so let me just upload them so here you can drag and drop so it will upload all the images here okay fine let's take two images only now here what I will do I'll just uh click on Save and continue okay see it has came here now it is asking for assigning uh the image okay for The annotation if you have different teammates so I don't have any teammate so I'll assign me then after that I will start the annotation now see guys you will get this kinds of interface now you can start doing The annotation now guys here instead of selecting this polygon okay polygon uh tool I think this is the same polygon tool I think I showed you okay from this example so you can uh use this particular tool to do the manual actually annotation but I won't be using this polygon tool instead of that I will be using this smart polygon okay and it is telling uh this smart polygon uses an intelligence assistant okay to draw your polygon uh click the center of your object uh then keep uh clicking to add or sub substract area Okay so this is the Smart polygon and by uh in the back end actually on this smart polygon actually tool they're using this particular Sam model okay they're using this particular Sam model so actually overflow developer team they integrated Sam model with this particular tool okay and they created this smart polygon now if I select the smart polygon so I'll just going with the standard because if you uh select the enhance so it will take some time to load the model enhance is like very good good model uh like it works actually better than your standard so I'll be by default selecting the standard because I want to show you the quick annotation uh so I selected this particular smart polygon so let's take this this uh image actually okay so this image is a little bit clear so I'll be uh showing this image now here let's say if I click here okay I just click just one okay see uh one point I just added here and see it has done the entire segmentation for me okay it has created entire masks for me only just one particular click I have done now I'll just click uh another click okay see I'll do the another click and it will uh complete I think so if it is not then again you can delete it and you can try uh see done now again just uh click here see again click here so see the more complex actually your object would be so you just need to take a smaller step that time and it will complete the segmentation for you see guys so I have just done the few click okay and my entire uh segmentation is ready okay entire segmentation is ready now if you want to accept it just click on finish enter and give The annotation group okay so this is crack and I will just save enter see it's done so now see guys uh I think you saw the difference between this Sam model and your manual annotation so in manual annotation we so in manual annotation I think you saw we have already done we have already spent lots of time to do uh The annotation for just one particular image okay but whenever I'm using this particular Sam model uh okay using just few click actually I can uh complete my annotation and again this crack is like very uh complex uh actually object okay that's why uh you need some few clicks but let's say whenever you are having some different object let's say you want to segment out horse dogs or anything let's say fruits CS anything so only just one click if you do on that particular object it will segment out entire objects okay see they have already given the demo visual demo see guys they' have already given the visual demo see okay only just you need to do one click and it will do the segmentation for you see only one click and it will segment entire object for you okay so that's how actually you can try with different data I have shown you with the help of this crack because I just wanted to show you what is the difficulties actually you will face whenever you will be implementing this kinds of complex project okay now what you can do you can select the next image okay let's say this is my next image and you can also do do it for this image so see guys this is my next image so I'll just click here so first of all it will segment out now I'll just go a smaller step because here is the complex actually path now I'll just click here uh see guys okay if you just uh take a smaller step so beautifully it will segment out this particular crack now I'll go this side again I will go this side again this side again this side okay done now I'll just assign the label finish and enter again it's a crack save enter it's done okay uh so guys uh if you see I have completed all the images I'm only having two images so it is completed now what I will do I will go back okay I will go back and I can add this uh images to my data set and add images I think I showed you like how to save the images okay after doing The annotation already I showed you in my previous video uh Auto Image annotation uh I think uh here okay here I already used actually overlow annotation there actually I showed you how to save this particular image okay after that you can create a version so here I can create a version or here what I can do uh yeah I can create a version then after that if you want you can perform some pre-processing step okay I'll just continue I don't want to perform augmentation I don't want to perform then I'll just finally create my image okay see I'll be creating the image then my image is ready now what you can do actually uh you can export this particular data set now here you can uh like uh select the format like which framework you will be using to the like segmentation task you can see select and you can download the zip file if you just click on continue it will download the Z file either you can use one code snipp it and you can also download the image okay it is also possible okay so now guys see with the help of this Sam model OKAY segment anything model you can perform these kinds of segmentation annotation okay uh like in a very good way okay you in a very good way in a short period of time only using some few clicks if your object is very complex then you should uh use few clicks but if it is like a very uh actually clear object like this kind of horse or fruits or anything so definitely only one click okay you can also do The annotation okay it is also possible so yes guys I hope you like this particular video if you have liked this particular video please uh subscribe to my channel and share this video with your friends and family and please uh hit on the like button okay uh and you can let me know what kinds of video actually want from me okay so I'll try to create that particular video okay so only just need to support my channel okay that's it I think guys uh this is all from my side I uh already explained this uh segment and I think um actually model OKAY in future actually I'll just bring some projects on top of it so I'll try to bring one end to end projects okay this uh uh segmentation related projects okay there actually I will show you how to create a pipeline and all okay if you want these kinds of video from my side so please support my Channel please subscribe to my channel okay so that I can uh show you this other implementation so yes guys uh thank you for watching this video and I'll see you next time
Info
Channel: DSwithBappy
Views: 1,024
Rating: undefined out of 5
Keywords: segment anything, segmentation, labeling, Detection, sam, segment anything model, image segmentation, computer vision, bounding box, object detection, annotation, smart Polygon, Roboflow
Id: NTO3SbYeiWE
Channel Id: undefined
Length: 18min 22sec (1102 seconds)
Published: Fri Feb 16 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.