Segment Anything is an image segmentation model developed by Meta AI. It is designed to reduce the need for custom data annotation, training compute, and task-specific modeling expertise.
SAM for Topography data (SAM_TOPO) is a Graphical User Interface (GUI) program backed by Meta’s Segment Anything Model (SAM) to offer interactive segmentation capacities on topography datasets.
Features:
- easy to customize matplotlib-based GUI
- Segment everything first and then interactive segmentation for individual masks
Please follow the instructions to install segment-anything
: https://github.com/facebookresearch/segment-anything.git
Install sam_topo
:
git clone https://github.com/OpenTopography/Segment_Anything_Model_Topography.git
cd sam_topo
pip install .
- Run GUI for interactive segmentation
python3 gui.py
- Use the
sam_topo
library
from sam_topo.gui import SAM_Topo_GUI
sam_topo_gui = SAM_Topo_GUI(img_path='../data/data/sample_data/beach_hillshade_grayscale.png',
sam_checkpoint = "../data/models/sam_vit_h_4b8939.pth",
model_type = "vit_h",
is_cuda=True)
- Tiff data preprocessing: SAM requires RGB images.
sam_topo.preprocessing
provides functions to convert tiff data to color or grayscale images.
- Segment everything
- Visualize individaul mask
- Delete masks
- Modify individaul mask
- Jupyter notebook option (preview)
@article{chen2023segmenting,
title={Segmenting geologic landforms using zero-shot deep learning and lidar topography},
author={Chen, Zhiang and Scott, Chelsea and Schwarz, Madeline F and Johnstone, Sam and Crosby, Christopher J and Arrowsmith, Ramon},
journal={AGU23},
year={2023},
publisher={AGU}
}
https://agu.confex.com/agu/fm23/meetingapp.cgi/Paper/1352775
@article{kirillov2023segany,
title={Segment Anything},
author={Kirillov, Alexander and Mintun, Eric and Ravi, Nikhila and Mao, Hanzi and Rolland, Chloe and Gustafson, Laura and Xiao, Tete and Whitehead, Spencer and Berg, Alexander C. and Lo, Wan-Yen and Doll{\'a}r, Piotr and Girshick, Ross},
journal={arXiv:2304.02643},
year={2023}
}