/SAMPLS

Adopting Segment-Anything-Model for Plant Science research

Primary LanguageJupyter Notebook

SAMPLS: A prompt engineering approach for Plant Science research

flowchart_img_2

Dependencies

  • PIL - 9.4.0
  • cv2 - 4.8.0
  • ipywidgets - 7.7.1
  • matplotlib - 3.7.1
  • numpy - 1.25.2
  • pandas - 1.5.3
  • session_info - 1.0.0
  • skimage - 0.19.3
  • torch - 2.1.0+cu121
  • scipy - 1.11.4
  • IPython - 7.34.0
  • jupyter_client - 6.1.12
  • jupyter_core - 5.7.1
  • notebook - 6.5.5
  • re
  • math
  • patchify
  • transformers
  • tifffile
  • supervision
  • segment_anyhting
  • base64
  • imagecodecs

Scripts

The following scripts are implemented in Google Colab in March 2024

Step 1: Running Vanilla SAM on images + prompt engineering

Step 2: Finetune SAM using results collected from Step 1 and finetuned prompt engineering

Step 3: Calculate the detection rate

Step 4: IOU scores calculation

Example of segmented images

image