Fork: 131 Star: 1607 (更新于 2023-06-02 17:01:18)

license: MIT

Language: Python.

A Python package for segmenting geospatial data with the Segment Anything Model (SAM)

最后发布版本: v0.8.1 (2023-05-25 09:13:08)

官方网址 GitHub网址


image image image image image Docker Pulls PyPI Downloads Conda Downloads DOI

A Python package for segmenting geospatial data with the Segment Anything Model (SAM)


The segment-geospatial package draws its inspiration from segment-anything-eo repository authored by Aliaksandr Hancharenka. To facilitate the use of the Segment Anything Model (SAM) for geospatial data, I have developed the segment-anything-py and segment-geospatial Python packages, which are now available on PyPI and conda-forge. My primary objective is to simplify the process of leveraging SAM for geospatial data analysis by enabling users to achieve this with minimal coding effort. I have adapted the source code of segment-geospatial from the segment-anything-eo repository, and credit for its original version goes to Aliaksandr Hancharenka.



  • Download map tiles from Tile Map Service (TMS) servers and create GeoTIFF files
  • Segment GeoTIFF files using the Segment Anything Model (SAM)
  • Segment remote sensing imagery with text prompts
  • Create foreground and background markers interactively
  • Load existing markers from vector datasets
  • Save segmentation results as common vector formats (GeoPackage, Shapefile, GeoJSON)
  • Save input prompts as GeoJSON files
  • Visualize segmentation results on interactive maps



  • Automatic mask generator

  • Interactive segmentation with input prompts

  • Input prompts from existing files

  • Interactive segmentation with text prompts


Video tutorials are available on my YouTube Channel.

  • Automatic mask generation

Alt text

  • Using SAM with ArcGIS Pro

Alt text

  • Interactive segmentation with text prompts

Alt text

Using SAM with Desktop GIS

Computing Resources

The Segment Anything Model is computationally intensive, and a powerful GPU is recommended to process large datasets. It is recommended to have a GPU with at least 8 GB of GPU memory. You can utilize the free GPU resources provided by Google Colab. Alternatively, you can apply for AWS Cloud Credit for Research, which offers cloud credits to support academic research. If you are in the Greater China region, apply for the AWS Cloud Credit here.


This package was made possible by the following open source projects. Credit goes to the developers of these projects.

最近版本更新:(数据更新于2023-06-05 14:05:07)

2023-05-25 09:13:08 v0.8.1

2023-05-24 12:08:14 v0.8.0

2023-05-21 10:26:20 v0.7.0

2023-05-18 02:31:03 v0.6.2

2023-05-17 11:52:30 v0.6.1

2023-05-17 10:18:23 v0.6.0

2023-05-11 04:59:18 v0.5.0

2023-05-06 12:53:18 v0.4.0

2023-04-26 23:19:53 v0.3.0

2023-04-21 21:57:07 v0.2.0


artificial-intelligence, deep-learning, geopython, geospatial, machine-learning, segment-anything, segmentation


2023-06-06 01:35:05 mmabrouk/chatgpt-wrapper

2023-06-05 23:25:24 bmaltais/kohya_ss

2023-06-05 23:03:20 zauberzeug/nicegui

2023-06-05 11:05:30 hwchase17/langchain

2023-06-05 07:01:44 bridgecrewio/checkov

2023-06-04 20:21:14 arc53/DocsGPT