Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 1.86 KB

File metadata and controls

84 lines (59 loc) · 1.86 KB

SAM Segmentator

SAM Segmentator is an GUI application created for educational segmetational purposes. Segmentator outputs:

  • Original image
  • Mask
  • Txt annotation (for models like YOLO)

Table of Contents

Installation Usage Features

Installation

  1. Setup CUDA and CUDNN
    https://developer.nvidia.com/cuda-toolkit
    https://developer.nvidia.com/cudnn
    
  2. Clone the repo:
    git clone https://github.com/lukasiktar/SAM_segmentator.git
    
  3. Download the SAM model from:
    https://github.com/facebookresearch/segment-anything.git
    
  4. Install Opencv library from:
     https://github.com/opencv/opencv.git
    
  5. Build torch and torchvision from (it is reccomended to build from source with CUDA support for your CUDA version):
    https://pytorch.org/get-started/previous-versions/
    
  6. Install Tkinter
    sudo apt install python3-tk
    
  7. Install segment-anything and albumentations
    pip install segment-anything albumentations
    
  8. Download the repository and store it in the working directory:
    git clone https://github.com/OpenGVLab/SAM-Med2D.git
    
    

Usage

To start the application, build the Python executable and start it.

Choose the SAM or Custom model segmentation:

SAM:

  1. Choose the apropriate image
  2. Draw the bounding box around specified object or click on it
  3. Perform segemetation using SAM
  4. Edit segmentation (if neccessary)
  5. Save the segmetation results

Custom model:

  1. Load the dataset
  2. Check the given annotation and modify if neccessary.
  3. If the annotation is not present, perform manual annotation.
  4. Save the segmentation results

Features

SAM:

Segment using Point prompt Segment using Box prompt Edit the segmentation Accept or Reject segmentation

Contour Editor:

Automatic segmentation Manual segmentation