Segmenting using SAM (Segment Anything Model) through AZURE AI Studio

Here I summerize an examplary procedure to perform an image segmentation using Meta’s SAM model through Azure AI studio.

  • start AI studio (AI studio use example for OpenAI chat article)
  • open “Deployment” component and create a new "facebook-sam-vit-base-4
    " model.
  • work on your desktop with Azure CLI environment
  • Reference to an example code shown in “consume” tab of the model page to build the segmentation inference code. Here I have used a python case.

The segmentation code is shown in AIStudio-sam/seg.py at main · dchoi/AIStudio-sam · GitHub.
An image of brain with a tumor is shown here

Segmentation image resulted from the code is shown here

Reference