SAM - Segment Anything Model by Meta AI: Complete Guide | Python Setup & Applications

Поділитися
Вставка

КОМЕНТАРІ • 135

  • @cedricvillani8502
    @cedricvillani8502 Рік тому +3

    Seriously you don’t need to pay these people for a API garbage, this is old look up panoptic segmentation stop giving these people your money and your data that’s all an API is it’s an application programming interface. In other words you’re just paying them when you don’t need it.

  • @samzhu6728
    @samzhu6728 11 місяців тому +2

    Thanks for the wonderful video! Is it possible to annotate specific objects (with labels) in a few frames of a video (fixed perspective) and keep tracking those objects in the entire video?

  • @Coolernerd-z7p
    @Coolernerd-z7p 11 місяців тому +2

    Nice video! I have 1 question, can you please suggest which is better out of this "SAM" or "YOLOv6-v3" for real-time detection in terms of accuracy? My requirement is to detect car parts(e.g. Michelin tire).
    Thank you in advance.

    • @Roboflow
      @Roboflow  11 місяців тому

      If you want to run real time, then you can’t use SAM. It will be to slow.

    • @Coolernerd-z7p
      @Coolernerd-z7p 11 місяців тому

      @@Roboflow: Thank you very much for your quick response! For our specific requirement to detect car parts(e.g. wheel type - alloy wheels or not, specific accessory, etc.,) after captured image being uploaded(taken from mobile camera), can you please suggest best algorithm based on your vast experience in this area? Do you recommend YOLOv6-v3 or GroundingDINO or any other? Tons of thanks to you again in advance!

  • @aarontan5434
    @aarontan5434 11 місяців тому +1

    ---------------------------------------------------------------------------
    TypeError Traceback (most recent call last)
    in ()
    ----> 1 mask_annotator = sv.MaskAnnotator(color_map='index')
    TypeError: MaskAnnotator.__init__() got an unexpected keyword argument 'color_map
    I got this error. May I know what went wrong?

    • @Roboflow
      @Roboflow  11 місяців тому

      Hi! I just fixed the notebook. Feel free to try it. :)

    • @karlvanbree4882
      @karlvanbree4882 11 місяців тому

      guess he meant: sv.MaskAnnotator(color_lookup = "index")

  • @kobic8
    @kobic8 Рік тому +3

    Thanks so much for the clear video! Are you planning on also intergrate it with some tools to get an output that will include also labels of each mask?

    • @Roboflow
      @Roboflow  Рік тому +1

      We already did. Take a look here: colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/automated-dataset-annotation-and-evaluation-with-grounding-dino-and-sam.ipynb

  • @ifeanyianene6770
    @ifeanyianene6770 Рік тому +2

    Thanks so much for this video!! Is there another way to draw the bounding box (in like a single python file format whereby you just run your main function) that doesn't require jupyter widgets? Oh btw, Liked and subscribed you guys are awesome!

    • @Roboflow
      @Roboflow  Рік тому

      Thanks for like and sub ;) as for your question. That was the only interactive way that I could come up with. But if you don’t want to do it in interactive way than you have plants of options.

  • @JenishaThankaraj
    @JenishaThankaraj Рік тому +1

    Can we annotate polygon shape instead of rectangle using SAM

  • @drm8164
    @drm8164 Рік тому +1

    Help please, i need to learn computer vision, but i struggle a lot. Is the OpenCv certificate worth it, it's around 1200 us dollars ? Thanks

    • @Roboflow
      @Roboflow  Рік тому

      Take a look here: github.com/SkalskiP/courses. In general, the Internet is full of free resources. It is not worth paying 1200 USD for a course like that.

  • @VenyushTandon-k7e
    @VenyushTandon-k7e Рік тому +1

    How can I tag objects in a picture using SAM? For example: In the picture that was used in the video: Man holding a dog, I want to identify all the objects in the picture like man, Dog, building, etc

    • @Roboflow
      @Roboflow  Рік тому

      Stay tuned for our video tomorrow. 🔥 I’m going to show how to auto annotate images with Grounding DINO and SAM

  • @dloperab
    @dloperab Рік тому +4

    Great video... thanks Piotr and Roboflow for all the great videos you generate. I am resuming my interest in CV thanks to you!

    • @Roboflow
      @Roboflow  Рік тому

      This is big! If I managed to convince you even a little bit I am proud of myself.

  • @SweetShotGaming
    @SweetShotGaming Рік тому +1

    Is there any way you can create an auto-labeler using SAM? (SAM would take care of everything with no human intervention). My specific need would be to label lane markings, but for an entire dataset of raw images.

    • @SweetShotGaming
      @SweetShotGaming Рік тому

      Forgot to mention, great video! Is there any functionality with SAM where you can give it a few examples of what the label is and then it will assume the labels for the dataset. Thanks!

    • @Roboflow
      @Roboflow  Рік тому +1

      Yes! Stay tuned to our next vid. We are doing full auto dataset generation and generation of masks from boxes. Should be on Monday.

  • @Aziz-bg4ph
    @Aziz-bg4ph Рік тому +1

    How can I extract the segmented object produced by SAM?

    • @Roboflow
      @Roboflow  Рік тому

      You can find masks inside `sv.Detections` object. `detections.masks`

    • @darinkumarnsit4780
      @darinkumarnsit4780 Рік тому

      @@Roboflow Could you show me how to use 'detections.masks', please? I try to use it and got AttributeError: 'Detections' object has no attribute 'masks'

  • @diyorpardaev
    @diyorpardaev 7 місяців тому +1

    It is really best video ever)I am making a great project with using sv

    • @Roboflow
      @Roboflow  7 місяців тому +1

      This is so kind! Thank you very much!

  • @willemweertman1178
    @willemweertman1178 Рік тому +3

    You should try it with data taken in a underwater marine context. Lots of models struggle with that.

    • @Roboflow
      @Roboflow  Рік тому

      Cool idea!💡 I work on next vid I’ll try to take that into consideration

    • @ish694
      @ish694 Рік тому

      Trying to work on the same use case with coral segmentation

  • @GohOnLeeds
    @GohOnLeeds Рік тому +1

    Since SAM is trained on photos, any idea how well it does on synthetic images, like artwork or games? Cheers

    • @Roboflow
      @Roboflow  Рік тому

      Great question. Unfortunately I didn’t experiment with those :/ sorry

  • @mithilanavishka4531
    @mithilanavishka4531 5 місяців тому

    Hi i am in the process of learning this SAM model follwing your video , this is very helpful i am planing to use this model to segmentahistorical documents charchters, according to your knowledge will it be possbile or time wasting ?

    • @Roboflow
      @Roboflow  5 місяців тому

      SAM is not really good at document segmentation

  • @sanketgarg6910
    @sanketgarg6910 Місяць тому

    Hey, great explanation I have a question can we do a multitask in a bounding box for example different layers of liquid in a bounding box vial if yes can you explain how? Thanks!

  • @cedricvillani8502
    @cedricvillani8502 Рік тому

    So how many SAMs Dics are you expecting to come in and out of your model? You just seem to really enjoy SAMs Dics, but I suppose using research from Michael J Black, about 10 years ago, and it makes sense why you really enjoy utilizing SAMs Dics

  • @unknown-wm9ru
    @unknown-wm9ru Рік тому +1

    This still doesn't work in live action does it? Like if I connected it to a camera or a vr headset like the meta quest pro/ pico 4 and used their cameras for AR powered by Sam. That would definetly be awsome!

    • @Roboflow
      @Roboflow  Рік тому

      You should get few fps. But if you want 30 fps, than we are not there yet.

    • @unknown-wm9ru
      @unknown-wm9ru Рік тому +1

      @@Roboflow Hmm I see, but the fact that it's there already is awesome in itself! The future is here and It's really exciting I love it

    • @Roboflow
      @Roboflow  Рік тому

      @@unknown-wm9ru true that!

  • @welingtongoncalvessilva2498
    @welingtongoncalvessilva2498 23 дні тому

    i got this error :
    AttributeError Traceback (most recent call last)
    in ()
    ----> 1 box_annotator = sv.BoxAnnotator(color=sv.Color.red())
    2 mask_annotator = sv.MaskAnnotator(color=sv.Color.red(), color_lookup=sv.ColorLookup.INDEX)
    3
    4 detections = sv.Detections(
    5 xyxy=sv.mask_to_xyxy(masks=masks),
    AttributeError: type object 'Color' has no attribute 'red'

    • @Mnephisto
      @Mnephisto 23 дні тому +1

      I'll look into it. Check back in a few hours!

    • @Roboflow
      @Roboflow  23 дні тому

      Thanks a lot Linus!

  • @imimiliades629
    @imimiliades629 5 місяців тому

    Hello! Can anybody explain how i can evaludate this model after training? What commands can i run?

  • @badrinarayanan686
    @badrinarayanan686 4 місяці тому

    Great video!! I do have a question. How do we use MskAnnotator to annotate only one specific mask instead of the entire set of masks in sam_result?

  • @javier_medel
    @javier_medel Рік тому +1

    Great video, Do youthink that you can share the jupyter notebook?

    • @Roboflow
      @Roboflow  Рік тому +1

      It is linked in description ;) all our demo notebooks are open sourced

  • @geniusxbyofejiroagbaduta8665
    @geniusxbyofejiroagbaduta8665 Рік тому +3

    I can't wait to see how it can be used for annotations

    • @Roboflow
      @Roboflow  Рік тому

      Stay tuned for RF update;) we also plan to drop one more video probably Friday/Monday where we will dive deep into auto annotation in Colab

    • @Roboflow
      @Roboflow  Рік тому

      We have released a feature enabling you to use SAM in Roboflow to label images as you mentioned: blog.roboflow.com/label-data-segment-anything-model-sam/
      Let us know what you think!

  • @TheArkLade
    @TheArkLade Рік тому +1

    For [Single Image Bounding Box to Mask] what should be changed if we have more than 1 class and want to see detection for all classes?

    • @Roboflow
      @Roboflow  Рік тому +1

      Hi it is Peter from the video 👋🏻 So you want to have multiple boxes converted into multiple masks?

    • @TheArkLade
      @TheArkLade Рік тому

      @@Roboflow Yes. so two-part question: (1) current script returns one mask at a time. How can I change it so it returns all detected masks? (2) Let's suppose I have 5 classes. How should I do so that all detections for all 5 classes are shown?

  • @BabasahebMane-d9v
    @BabasahebMane-d9v Рік тому +1

    Is it possible to get segmentated image without passing its bounding box?

    • @Roboflow
      @Roboflow  Рік тому

      You don’t need to pass box. If you won’t pass any prompt the whole image gets segmented.

  • @lalamax3d
    @lalamax3d Рік тому +1

    first tutorial using sam should be mask of yourself which you showed on 36sec of this video. but thanks anyways

    • @Roboflow
      @Roboflow  Рік тому +1

      Just convince my boss to do it and you’ll have it ;)

    • @lalamax3d
      @lalamax3d Рік тому +1

      @@Roboflow i like your boss. now when you got time for that. (imho) please keep few pointers in mind
      a- do it with image sequence or video or both
      b- getting progress bar / status tqdm / queue
      c- giving area/prompt in one go.
      d- how to acheive consistancy.. etc.. if subject move out or something come in front (if possible)

  • @kgylsd
    @kgylsd Рік тому +1

    Please let us know anytime when the SAM/ Roboflow integration is accomplished 😊

    • @Roboflow
      @Roboflow  Рік тому +2

      It will be for sure part of out weekly newsletter! ;)

    • @Roboflow
      @Roboflow  Рік тому

      We have released a feature enabling you to use SAM in Roboflow to label images as you mentioned: blog.roboflow.com/label-data-segment-anything-model-sam/
      Let us know what you think!

  • @DTM6559
    @DTM6559 10 місяців тому

    How can I train with different color masks rather than black and white mask??

  • @anestiskastellos4150
    @anestiskastellos4150 Рік тому +2

    Very nice video. Next video -> Grounded Segment Anything !! 👏

    • @Roboflow
      @Roboflow  Рік тому +1

      🚨 SPOILER ALERT: That's the plan!

    • @abdshomad
      @abdshomad Рік тому +1

      Second that! +1

    • @Roboflow
      @Roboflow  Рік тому +1

      @@abdshomad I think we should have something by Friday/Monday

  • @mnx64
    @mnx64 Рік тому +1

    You said it’s real time ready - but what IS real time ready is only the prediction for various prompts on the *same* image. Generating the embeddings for each new image is actually really slow (multiple seconds depending on image size and hardware) and cannot be done in browser or in real time. This makes it less useful for live/video analysis, of course, but it’s still great to generate segmentation mask training sets! Thanks for the video

    • @Roboflow
      @Roboflow  Рік тому

      Hi 👋🏻 It’s Peter from the video. You are right I really think I shouldn’t say that because it is confusing. The decoding part is very fast and can get executed in real time, but the encoding is quite slow. Can be faster if you use version B versus version H but still… So I really wish I would be more precise. Apologize for that.

    • @mattizzle81
      @mattizzle81 Рік тому +1

      There is a fully onnx optimized and quantized model out there that is faster. Still not ultra fast but at least 1 FPS on my RTX 2080 ti, which is not bad. Semi real-time.

    • @Roboflow
      @Roboflow  Рік тому +1

      @@mattizzle81 thanks for that info I was actually not aware of that… but still I think it would be much cleaner without that sentence in the vid :)

  • @Xfunfunny8605k
    @Xfunfunny8605k Місяць тому

    Plz made video by custom data set ..

  • @MrJesOP
    @MrJesOP Рік тому +1

    First of all, thank you so much for the content, amazing contribution to the community! I wonder if it is possible to implement the negative point prompt in the SAM model similarly as it can be done in the website, where you can choose several points belonging to the object that you are interested in as well as points that do not belong to it... Some help would be amazing!!
    Thanks in advance!!

    • @Roboflow
      @Roboflow  Рік тому

      Hi thanks a lot for those kind words :) As for your question - "implement the negative point prompt". I was looking for any project that would implement that functionality. And I didn't found anything :/

  • @alaaalmazroey3226
    @alaaalmazroey3226 7 місяців тому

    Does SAM segment all objects in the scene very well when there is an occlusion?

  • @froukehermens2176
    @froukehermens2176 9 місяців тому

    One use case is the annotation of eye tracking data. Per video frame one would like to annotate whether a person is looking at other people or objects in the environment. One could use YOLO and bounding boxes, but these are less precise than regions.

  • @EkaterinaGolubeva-pr9ih
    @EkaterinaGolubeva-pr9ih Рік тому

    Can you make a video on MedLSAM ( medical localize and segment anything model) ?

  • @fintech1378
    @fintech1378 Рік тому +1

    how can this model be used in detecting type and quantity of inventory in a shop?

    • @Roboflow
      @Roboflow  Рік тому

      Hi it is Peter from the video. I think that if you look for type and quantity of inventory in a shop you will be much better off with using detection models like YOLOv8 or YOLO-NAS.

  • @jamtomorrow457
    @jamtomorrow457 Рік тому

    Hi thanks for the great tutorial! How can I download the masks created using SAM and upload them into roboflow?

  • @shamukshi
    @shamukshi Рік тому

    Do you do freelancing ? my ACADEMIC project is "solar panel detection and counting using SAM."

    • @Roboflow
      @Roboflow  Рік тому

      Nope. We do not do freelancing. :/

  • @tomtouma
    @tomtouma Рік тому +1

    Can it be used to segment and label objects in a video stream from a live camera? I've been reading a lot of the feedback and people are saying it's computationally heavy and will run too slow at a meaningful refresh rate. I noticed the Meta advertisement was doing it in realtime and labeling and tracking stuff. What are your thoughts on this? Is it easier to stick to OpenCV/Yolo for a live video feed?

    • @Roboflow
      @Roboflow  Рік тому

      > I noticed the Meta advertisement was doing it in realtime
      Could you point me to the resource?

    • @tomtouma
      @tomtouma Рік тому +1

      @@Roboflow At about 0:06 in your video. Looks like real time?

    • @Roboflow
      @Roboflow  Рік тому +1

      @@tomtouma I wish! That was just a lot of work online to produce it. It is not real time.

    • @tomtouma
      @tomtouma Рік тому

      ​@@Roboflow Could you explain what you mean by "work online"? Do you mean the Meta team recorded a video and then post-processed the video offline? Also, is there a way to pass video frames (even if it is very slow like 1Hz or slower) to SAM and have it segment the image frames? I want to then run some python scripts to get me geometry information about these segmented masks.

    • @tomtouma
      @tomtouma Рік тому +1

      Just thought I'd bump this.

  • @deeplearningexplained
    @deeplearningexplained Місяць тому

    Really solid video, loved the intro haha

  • @SS-zq5sc
    @SS-zq5sc Рік тому +1

    This was a great explanation and so was your blog entry. You gained another subscriber today. Thank you!

    • @Roboflow
      @Roboflow  Рік тому

      Hi, it is Peter from the video :) That's awesome to hear! Thanks a lot!

  • @husseinali-yx7uf
    @husseinali-yx7uf Рік тому +1

    Thanks for your video I have learnt a lot from you but this time each time i try to follow up with your steps this error encounter me :
    ---------------------------------------------------------------------------
    OutOfMemoryError: CUDA out of memory. Tried to allocate 14.40 GiB (GPU 0; 15.90 GiB total capacity; 6.53 GiB already allocated; 7.95 GiB free; 7.12 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    • @Roboflow
      @Roboflow  Рік тому

      Is that happening in notebook?

    • @saharabdulalim
      @saharabdulalim Рік тому

      try using parallel gpu

    • @husseinali-yx7uf
      @husseinali-yx7uf Рік тому

      @@Roboflow
      Yes on both google colab and kaggle

    • @husseinali-yx7uf
      @husseinali-yx7uf Рік тому

      @@saharabdulalim how to do that?

    • @Roboflow
      @Roboflow  Рік тому

      @@husseinali-yx7uf od that happening with your own image?

  • @chinnagadilinga5742
    @chinnagadilinga5742 Рік тому

    Hi Sir I'm Beginner in I saw your Computer vision video's its fully combined and merged can you please update one by one video order that time we can understand easily thank you.

    • @Roboflow
      @Roboflow  Рік тому

      Hi :) Are you only interested in auto annotation videos? Or all of them?

  • @유영재-c9c
    @유영재-c9c Рік тому

    How can I do semantic segmentation labeling using sam?

  • @itayhilel2168
    @itayhilel2168 Рік тому +1

    Let's do this on a superstore dataset

    • @Roboflow
      @Roboflow  Рік тому

      send a link :D I'll take a look

  • @EkaterinaGolubeva-pr9ih
    @EkaterinaGolubeva-pr9ih Рік тому

    Thank you ! Can SAM handle 3D images ? Any advice on how to approach it ?

  • @ruiteixeira2324
    @ruiteixeira2324 Рік тому +1

    Very nice work. How do you see SAM being used in practice? You see this as a model to be integrated in a tool to generate training data for your task or being your final model for a certain task?

    • @Roboflow
      @Roboflow  Рік тому +1

      Hi 👋! It is Peter from the video. I think we will see broad use of SAM in image and video editors. But I also think it will be the default feature in all major annotation tools. It is a bot too slow for real-time usage. But we will transfer the knowledge it provides int datasets that we use for training real-time models. What is your prediction?

    • @ruiteixeira2324
      @ruiteixeira2324 Рік тому

      ​@@Roboflow yes, I totally agree with you on the fact that it will be the default tool to annotate data. Since you think this is to slow, what's in your opinion the current state of art model for semantic segmentation for real-time applications?

    • @Roboflow
      @Roboflow  Рік тому

      @@ruiteixeira2324 hahaha hard question. According to papers with code that would be latest version of YOLOv6.

    • @Roboflow
      @Roboflow  Рік тому

      Hi Rui - we have released a feature enabling you to use SAM in Roboflow to label images as you mentioned: blog.roboflow.com/label-data-segment-anything-model-sam/
      Let us know what you think!

  • @swipeshark5311
    @swipeshark5311 7 місяців тому

    Не рабочий код, дизлайк

  • @ORLANDOCAN-h7x
    @ORLANDOCAN-h7x 9 днів тому

    how can i proove with my own images?

  • @lorenzoleongutierrez7927
    @lorenzoleongutierrez7927 Рік тому +1

    Great !

  • @gbo10001
    @gbo10001 Рік тому +1

    wow that's really great waited for that...

    • @Roboflow
      @Roboflow  Рік тому

      I’m super happy you like it!

  • @shaneable1
    @shaneable1 Рік тому

    Great video! Thank you! What hardware are you running this on?

  • @saharabdulalim
    @saharabdulalim Рік тому

    thank u for that ❤ i have a question ,when I make annotations for more than one object in image and pass it to sam it only mask one object like the brain cell in ur project and didn't mask the other objects in same image? i make it one class for all

    • @saharabdulalim
      @saharabdulalim Рік тому +1

      i think cuz of xyxy[0] but if i want to pass multimask on multi object?

    • @Roboflow
      @Roboflow  Рік тому +1

      @@saharabdulalim I'm actually working on next vid right now. And we will cover more general autoannotation usecases. Vid should be out tomorrow.

  • @MisterWealth
    @MisterWealth Рік тому

    how do we switch out with our own videos?

  • @iflag9775
    @iflag9775 Рік тому

    Great! Could you give a talk on possibility of object detection with SAM

    • @Roboflow
      @Roboflow  Рік тому

      Hi 👋🏻 Could you please explain a bit more what do you mean? It is segmentation model. Would you like to convert masks into boxes?

  • @anandhsaspect4560
    @anandhsaspect4560 Рік тому +1

    Great. Thanks.

  • @mohammedinnat1247
    @mohammedinnat1247 Рік тому +1

    Nice. Thanks.

  • @날개달린_양
    @날개달린_양 Рік тому

    Thank you so much

  • @yatinarora9650
    @yatinarora9650 Рік тому

    Great video , create some video to explain how SAM works internally please