Label Data with Segment Anything Model (SAM) in Roboflow
Key Takeaways
The video demonstrates how to use the Segment Anything Model (SAM) in Roboflow for zero-shot segmentation labeling, leveraging the Smart Polygon feature for efficient object segmentation and annotation. It showcases the model's capabilities in converting bounding boxes into polygons and handling occluded objects, with a focus on increasing labeling productivity and accuracy.
Full Transcript
few days ago we released a video about segment anything modeled by meta Ai and in that video I mentioned that our engineering team was working on the integration of Sam into roboflow annotation tool and today we can take a look at the results of their hard work I selected three different data sets from roboflow universe and we will pick few images from each of them and re-annotate them using some so without further Ado let's dive in and let me show you how fast you can annotate complicated objects with smart polygon in roboflow editor okay so let's start with one of my favorite data sets in roboflow universe and this is the concrete cracks data set I actually used it in one of my previous demo videos at our channel before so before I started recording I created empty project in my workspace and right now I'm just copying images from this already annotated project into mine and hopefully I will be able to recreate those annotations but much faster let's keep the whole copying process as it is not the main topic of this video and jump straight into the editor pick smart polygon tool and hover it over the crack and after split of a second I see the preview of my polygon I just click and I get the first version of it we can see that it only got highlighted partially but while I'm still in editing mode I can just pick one more point this time in the part of the crack that was not highlighted originally and now our annotation is complete we have the full crack mask we can just hit enter it will convert our mask into polygon hit enter once again to confirm that we want to use crack class and we are done it was pretty fast so let's annotate one more we just hover over the crack wait until the editor will show us the preview of The Mask if it's acceptable we click and then hit enter to confirm hit enter once again to confirm that we want to use crack class and that's it now in this image there are actually two cracks the other one is very thin so I try to annotate it hovered over the crack but didn't get any preview that would be acceptable so we need to skip that and annotate it manually so stuff like that can happen especially in case of long thin objects unfortunately not every mask can be obtained with some let's take a look at next image here the case is much simpler got the mask right away so we just click enter enter next image same drill we just hover over the crack click when it's acceptable then enter enter to confirm and that's it I guess you can see that at this point the process is getting quite repetitive so we will jump into next example but like we saw even in case of hard to detect objects Sam is doing absolutely fine and in most cases our work is done in just few seconds next up we have blueberries so this is data set that already exists in roboflow Universe however originally it was annotated using bounding boxes and because there is a lot of objects on every image I thought it's a very good example that we can use so once again we have empty blueberries project in my workspace and I'm just selecting few images copying them into my project and we will use Sam to convert those bounding boxes into segmentations it's actually pretty easy I can just click with right button of my mouse on the bounding box and select convert box into smart polygon and that's it this obviously increase our labeling productivity tremendously and notice how bounding boxes around the objects are not necessarily super tight and some can still figure out which part of the bounding box contain the object that we want to annotate and which part of the bounding box is basically a background that needs to be removed and at the same time even when one object is occluded by another like in this case the blueberry is occluded by the leaf it can still figure out how to properly annotate that which is you yeah super awesome okay so let's speed up the recording a little bit as you can see it's pretty repetitive process so I'm just using the same functionality over and over again but here here is quite an interesting example so you can see that within the same bounding box we had a blueberry annotation but there was also a leaf and interestingly enough the leaf was in the foreground so some thought that in this particular case we are most interested in the leaf not the blueberry because it's kind of blurred and in a background so I could just remove a prediction provided by some and use the manual tool to hover over the blueberry and select this mask instead so because it's not fully automated process you can still fix your mistakes along the way okay so I think that I will spare you looking at me converting those bounding boxes into segmentations and and we will take a look at the final result so here it is the initial image annotated with bounding boxes for object detection on the left side and the same image but annotated with polygons on the right side the quality of the masks is really good but what blows my mind the most that whole process where I converted the bounding boxes into polygons fix few things along the way and even added some annotations for some blueberries that were not annotated before took me four minutes to do I'm pretty confident that with the traditional approach where I'm just drawing the polygons in the editor that would take me easily 30-40 minutes and I'm not even sure if I would be able to deliver the same quality of the annotations in case of both demos that we already saw there is one common factor and that is the quality of the images in both cases we used higher resolution images with easily recognizable objects even if one object occluded another it was quite easy to figure out where is The Edge between them so now let's take a look at a bit harder use case and try to segment blood cells on microscope images similarly as before I copied few images from public data set into my private one and now we will convert those bounding boxes into segmentations let's start with the huge white cell in the middle that was most likely the easiest of them all similarly like in the case of blueberries we just hit the right button and use the convert bounding box to Smart polygon functionality and now you can do exactly the same for other blood cells we can see that even though that the overall resolution of the image is much lower and the quality of damage is also worst it is doing quite well for most of the blood cells from time to time we we need to pick the manual tool to create new annotation because not every blood cell is annotated but the process is very similar to the one that we already covered when we annotated cracks so we just hover confirm the polygon confirm the class and we are good to go the next few cells are interesting because they are close to each other and they also heavily overlap each other but we see that we had no problem with the first one we got a bit weird polygon for the second one and the third one was also generated quite well so now we need to zoom in to fix our polygon we just click on the anchors that we want to delete and drag the and cores that we want to move and after just few adjustments the mask is ready let's speed up the video a bit and take a look how efficiently we can convert the bounding boxes into the masks but also how easy it is to add annotations for objects that were not originally annotated like previously in some cases we need to do some adjustments either by manually annotating or just editing the polygon provided by Sam but after just few seconds we are done so there you have it segment anything model supporting polygon annotation in roboflow editor I highly encourage you to use it and let us know in the comment how it did on your data set remember that it works best on high resolution images but you can certainly give it a try even on those small ones best case scenario you are doing your annotations almost automatically and you just supervise the processed worst case scenarios you still need to do some manual adjustments either way you save a lot of time so if you are doing segmentation annotation in roboflow editor and you are not using some you are certainly missing out okay that's all from me today I hope my tips were useful in the meantime let I can subscribe and stay tuned for more computer vision content coming to this channel soon my name is Peter and I see you next time bye
Original Description
We are excited to release support for zero-shot segmentation labeling in Roboflow Annotate using Meta AI’s Segment Anything Model (SAM).
Using the Smart Polygon feature, you’re accessing a cloud-hosted Segment Anything model enabling you to apply polygon annotations faster, easier, and more accurately than ever before, right inside the Roboflow UI. No setup. No servers. No integrations. Create annotations with one click.
Chapters:
00:00 - Introduction
00:35 - Concrete Cracks Annotation with Smart Polygon
03:06 - Converting Bounding Box Blueberry Object Detection Dataset into Polygons
06:43 - Annotating Low-Resolution Blood Cells Images with Smart Polygon
08:47 - Conclusion
Resources:
🌏 Roboflow: https://roboflow.com
🌌 Roboflow Universe: https://universe.roboflow.com
📚 Launch: Label Data with Segment Anything in Roboflow blog: https://blog.roboflow.com/label-data-segment-anything-model-sam
🔥 Automated Data Labeling with SAM: https://youtu.be/oEQYStnF2l8
On July 29th, 2024, Meta AI released Segment Anything 2 (SAM 2), a new image and video segmentation foundation model. According to Meta, SAM 2 is 6x more accurate than the original SAM model at image segmentation tasks. Learn more: https://blog.roboflow.com/what-is-segment-anything-2/
Don't forget to like, comment, and subscribe for more content on AI, computer vision, and the latest breakthroughs in technology! 🚀
#MetaAI #SegmentAnythingModel #SAM #ImageSegmentation #ComputerVision
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Roboflow · Roboflow · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
YOLOv3 PyTorch Notebook Tutorial
Roboflow
How to Train YOLOv4 on a Custom Dataset (PyTorch)
Roboflow
How to Train YOLOv5 on a Custom Dataset
Roboflow
How to Use the Roboflow Dataset Health Check
Roboflow
What is Mean Average Precision (mAP)?
Roboflow
How to Use the Roboflow Model Library
Roboflow
How to Train EfficientDet in TensorFlow 2 Object Detection
Roboflow
How to Train YOLO v4 Tiny (Darknet) on a Custom Dataset
Roboflow
Ask the Roboflow Team Anything - Episode 1
Roboflow
Exploring The COCO Dataset
Roboflow
Community Spotlight: Improving Uno with Computer Vision
Roboflow
Mosaic Data Augmentation - Deep Dive
Roboflow
Hands on with the OAK-1
Roboflow
Glenn Jocher: What is New in YOLO v5?
Roboflow
How to Use Amazon Rekognition Custom Labels and Roboflow to Build an Object Detection Model
Roboflow
An Interview with Brandon Gilles, Luxonis Founder and OAK Chief Architect
Roboflow
How to Train a Custom Mobile Object Detection Model (with YOLOv4 Tiny and TensorFlow Lite)
Roboflow
Tackling the Small Object Problem in Object Detection
Roboflow
Fast.ai v2 Released - What's New?
Roboflow
Teaser: Roboflow Train (1-Click Computer Vision AutoML)
Roboflow
How to Train a Custom Resnet34 Image Classification Model
Roboflow
How to Label Images for Object Detection with CVAT
Roboflow
Deploy YOLOv5 to Jetson Xavier NX at 30 FPS
Roboflow
Elisha Odemakinde Hosts Roboflow ML Engineer, Jacob Solawetz
Roboflow
Getting Started with VoTT - Computer Vision Annotation
Roboflow
How to Manage Classes in Object Detection (Rename, Combine, Balance)
Roboflow
How to Train YOLOv4 on a Custom Dataset in Darknet
Roboflow
Is Grayscale a Preprocessing or Augmentation Step in Computer Vision?
Roboflow
Getting Started with Image Data Augmentation
Roboflow
Glenn Jocher: Image Augmentation in YOLO v5 and Beyond
Roboflow
GA Hosts Roboflow - Healthcare and AI
Roboflow
How do self driving cars know when to stop?
Roboflow
What is PASCAL VOC XML?
Roboflow
AutoML Showdown: Google vs Amazon vs Microsoft
Roboflow
How is computer vision changing manufacturing?
Roboflow
The Alphabet in American Sign Language
Roboflow
Luxonis OAK-D: Computer Vision on Device
Roboflow
How to Train a Custom Faster R-CNN Model with Facebook AI's Detectron2 | Use Your Own Dataset
Roboflow
TensorFlow vs PyTorch: Fireside
Roboflow
Occlusion Techniques in Computer Vision
Roboflow
A Customizable Web Application for Your Computer Vision Model
Roboflow
Model Tradeoffs and the Future of Computer Vision
Roboflow
Designing an Augmented Reality Board Game App
Roboflow
YOLOv4 - Advanced Tactics
Roboflow
How to Use CreateML and Build a Computer Vision iPhone App | AR Object Detection
Roboflow
Fireside Chat: Computer Vision in Agriculture
Roboflow
Scaled-YOLOv4 Tops EfficientDet: Research Rundown
Roboflow
What is Image Preprocessing?
Roboflow
Building a Community of Creators with BlkArthouse and Von Deon
Roboflow
How to Train Scaled-YOLOv4 to Detect Custom Objects
Roboflow
Intro to Computer Vision: Fireside
Roboflow
The Best Way to Annotate Images for Object Detection
Roboflow
The Computer Vision Process: Fireside
Roboflow
How to Annotate Images with Your Team Using Roboflow
Roboflow
Introducing the Roboflow Object Count Histogram
Roboflow
How Fast is the M1 at Machine Learning? Benchmarking Apple's M1 and Intel's Chips
Roboflow
CLIP: OpenAI's amazing new zero-shot image classifier
Roboflow
How I hacked my Nest camera to run custom models
Roboflow
Getting Started with the Roboflow Inference API
Roboflow
Transfer Learning in Computer Vision | What, How, Why
Roboflow
More on: CV Basics
View skill →Related Reads
Chapters (5)
Introduction
0:35
Concrete Cracks Annotation with Smart Polygon
3:06
Converting Bounding Box Blueberry Object Detection Dataset into Polygons
6:43
Annotating Low-Resolution Blood Cells Images with Smart Polygon
8:47
Conclusion
🎓
Tutor Explanation
DeepCamp AI