geo-sam

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.

https://github.com/coolzhao/geo-sam

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

deep-learning geospatial pytorch qgis-plugin satellite-images segment-anything-model segmentation
Last synced: 6 months ago · JSON representation

Repository

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.

Basic Info
Statistics
  • Stars: 320
  • Watchers: 10
  • Forks: 41
  • Open Issues: 48
  • Releases: 16
Topics
deep-learning geospatial pytorch qgis-plugin satellite-images segment-anything-model segmentation
Created over 2 years ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

Geo SAM

DOI Documentation Status

By Zhuoyi Zhao and Chengyan Fan from Cryosphere Lab, ESSC, CUHK.

Introduction

Geo-SAM is a QGIS plugin that aims to help people segment, delineate or label landforms efficiently when using large-size geospatial raster images. Segment Anything Model (SAM) is a foundation AI model with the superpower, but the model size is huge, and using it to process images can take a long time, even with a modern GPU. Our tool uses the strategies of encoding image features in advance and trimming the SAM model. The interactive segmentation algorithm can perform real-time inference (at millisecond speeds) on a laptop CPU, making it a convenient and efficient tool for dealing with remote sensing images.

The Geo-SAM plugin includes two separate parts: the Image Encoding Part, and the Interactive Segmentation Part. The image encoding part is designed to generate and save the image features using the SAM image encoder, and the encoding process only needs to run once per image. The segmentation part is for interactively segmenting landforms, and it can only be used to segment preprocessed images (whose features have been generated in advance using the encoding tool, as the included demo image).

| Comparison of the workflow between Geo-SAM and the original SAM | |:--:| | Comparison of the workflow between Geo-SAM and the original SAM. original SAM package encodes prompts and image simultaneously, while the Geo-SAM model encodes image into feature files at once and queries prompts in real-time (at millisecond speeds) by loading those saved features. |

Installation and Usage

Demos

  • Interactive Segmentation Demo (millisecond-level response time after providing prompts)

  • Preview Mode Demo for Interactive Segmentation (Execute SAM following the mouse cursor)

  • Image Encoder Demo (QGIS plugin part)

  • Encoder Copilot Demo
Copilot Demo

Highlights

  • Based on QGIS for a user-friendly GUI and cross-platform compatibility without programming skills needed.
  • It provides segmentation results instantly after giving prompts, and can even display results in real-time following the mouse cursor (Preview mode, currently only available in the dev version, will be added to the stable version after being rigorously tested). Users can have a smooth, interactive experience.This can greatly improve the efficiency and user experience of segmentation.

Notes

  • SAM is designed to segment one object once with a series of prompts, so you should save the current results before getting to the next one when using the Geo-SAM tool.
  • SAM natively supports only three-band images, but we have adapted Geo-SAM to support one or two-band images so that you can try grayscale images, spectral index images (like NDVI, NDWI), or even SAR images.
  • The Geo-SAM plugin is currently in active development. We will continue making improvements and welcome your feedback. If you have any questions or suggestions, please feel free to open an issue or discussion on our GitHub repository at GitHub Issues or GitHub Discussions.

Citation

Zhao, Zhuoyi, Fan, Chengyan, & Liu, Lin. (2023). Geo SAM: A QGIS plugin using Segment Anything Model (SAM) to accelerate geospatial image segmentation (1.1.0). Zenodo. https://doi.org/10.5281/zenodo.8191039

bibtex @software{zhao_zhuoyi_2023_8191039, author = {Zhao, Zhuoyi and Fan, Chengyan and Liu, Lin}, title = {{Geo SAM: A QGIS plugin using Segment Anything Model (SAM) to accelerate geospatial image segmentation}}, month = jul, year = 2023, publisher = {Zenodo}, version = {1.1.0}, doi = {10.5281/zenodo.8191039}, url = {https://doi.org/10.5281/zenodo.8191039} }

Acknowledgement

This repo benefits from Segment Anything and TorchGeo. Thanks for their wonderful work.

Owner

  • Login: coolzhao
  • Kind: user

GitHub Events

Total
  • Create event: 6
  • Release event: 2
  • Issues event: 15
  • Watch event: 100
  • Delete event: 3
  • Issue comment event: 42
  • Push event: 26
  • Pull request event: 2
  • Fork event: 12
Last Year
  • Create event: 6
  • Release event: 2
  • Issues event: 15
  • Watch event: 100
  • Delete event: 3
  • Issue comment event: 42
  • Push event: 26
  • Pull request event: 2
  • Fork event: 12

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 272
  • Total Committers: 3
  • Avg Commits per committer: 90.667
  • Development Distribution Score (DDS): 0.423
Past Year
  • Commits: 272
  • Committers: 3
  • Avg Commits per committer: 90.667
  • Development Distribution Score (DDS): 0.423
Top Committers
Name Email Commits
fanchengyan f****4@l****n 157
Joey Zhao z****9@g****m 109
Fanchengyan 1****8@q****m 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 34
  • Total pull requests: 1
  • Average time to close issues: 5 days
  • Average time to close pull requests: 2 minutes
  • Total issue authors: 20
  • Total pull request authors: 1
  • Average comments per issue: 3.06
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 minutes
  • Issue authors: 5
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • 4del-Yousefi (9)
  • cycle4 (5)
  • Martin-Dawson (3)
  • Segmentoholic (2)
  • BigBigOranges (2)
  • shizurumaya (2)
  • cullenfranchino1 (1)
  • jtgilbert (1)
  • wilson733 (1)
  • klara4390 (1)
  • initze (1)
  • rtfraser86 (1)
  • MohammadMr (1)
  • ClementAlba (1)
  • OMilosh (1)
Pull Request Authors
  • Fanchengyan (1)
  • Segmentoholic (1)
Top Labels
Issue Labels
Good for newcomers (7) bug (3) Feature request (2) needs detail (1)
Pull Request Labels

Dependencies

docs/requirements.txt pypi
  • Jinja2 <3.1
  • myst-parser *
  • recommonmark *
  • sphinx ==3.5.3
  • sphinx_rtd_theme *
  • sphinxcontrib-video *