← 开源
opengeos

segment-geospatial

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

AI EngineeringMake agent see hear talkPython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.0%
4.17k
Star
447
Fork
+4
本周
27
贡献者
创建于 2023-04-19 · 更新于 2026-10-16 · 今日第 4724 名
主要开发者
giswqsp-vdpbrendancol

opengeos/segment-geospatial 排名第 4,724,有 4,165 个星标。

同类别比较

opengeos/segment-geospatial 排名第 4,724,此处有 8 个同类条目;ai-robots-txt/ai.robots.txt 排名第 4,723。

同类别比较
名称排名指标
53AI/53AIHub4,708
语言:
Go
星标数:
4,331
分叉数:
500
简介:
53AI Hub is an open-source AI portal and knowledge base for managing enterprise knowledge, AI agents, prompts, and AI tools, seamlessly integrating with Coze, Dify, FastGPT, RAGFlow. 一个AI知识库与Agent门户
google-gemini/gemini-skills4,712
语言:
Python
星标数:
4,284
分叉数:
455
简介:
Skills for the Gemini API, SDK and model/agent interactions
kunchenguid/gnhf4,722
语言:
TypeScript
星标数:
4,196
分叉数:
313
简介:
Before I go to bed, I tell my agents: good night, have fun
ai-robots-txt/ai.robots.txt4,723
语言:
Python
星标数:
4,195
分叉数:
189
简介:
A list of AI agents and robots to block.
lumina-ai-inc/chunkr4,728
语言:
Rust
星标数:
4,150
分叉数:
278
简介:
Vision infrastructure to turn complex documents into LLM-ready data
cursor/cookbook4,732
语言:
TypeScript
星标数:
4,124
分叉数:
493
algolia/instantsearch4,736
语言:
TypeScript
星标数:
4,065
分叉数:
555
简介:
⚡️ Libraries for building performant and instant search and and discovery experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
microsoft/PromptWizard4,739
语言:
Python
星标数:
4,018
分叉数:
357
简介:
Task-Aware Agent-driven Prompt Optimization Framework
关键参数与规格
关键参数与规格
参数值
语言Python
类别AI Engineering
子类别Make agent see hear talk
关键词Computer vision
星标数4,165
分叉数447
贡献者27
创建日期2023-04-19
更新日期2026-10-16
1 天星标数1
7 天星标数4
排名4,724
上次排名4,894
排名变化170
7 天星标排名5,925
上次 7 天星标排名5,404
7 天星标排名变化-521
总星标排名3,344
上次总星标排名3,341
总星标排名变化-3
国家USA
README 摘录

SamGeo **A Python package for segmenting geospatial data with the Segment Anything Model (SAM)** Introduction The **SamGeo** package draws its inspiration from segment-anything-eo repository authored by Aliaksandr Hancharenka. The primary objective of SamGeo is to simplify the process of leveraging SAM for geospatial data analysis by enabling users to achieve this with minimal coding effort. The source code of SamGeo was adapted from the segment-anything-eo repository, and credit for its original version goes to Aliaksandr Hancharenka

. Free software: MIT license Documentation: Citations Wu, Q. samgeo: A Python package for segmenting geospatial data with the Segment Anything Model (SAM). _Journal of Open Source Software_, 8(89), 5663. The Segment Anything Model (SAM) for remote sensing applications: From zero to one shot. _International Journal of Applied Earth Observation and Geoinformation_, 124, 103540. Features Download map tiles from Tile Map Service (TMS) servers and create GeoTIFF files Segment GeoTIFF files using the Segment Anything Model (SAM) and HQ-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 Segment objects from timeseries remote sensing imagery REST API for serving segmentation over HTTP (see API docs) QGIS Plugin SamGeo is also available as a QGIS plugin. Check out this short video demo and full video tutorial on how

to use the plugin. Installation Install with pixi (Recommended) For the most reliable installation experience, especially on Windows or when dealing with complex dependencies like PyTorch/CUDA and SAM 3, we recommend using pixi. Pixi provides faster and more reliable dependency resolution than conda/mamba and avoids common numpy version conflicts. See the full pixi installation guide for detailed instructions. Quick start with pixi: Install from PyPI **segment-geospatial** is available on PyPI and can be installed in several ways

so that its dependencies can be controlled more granularly. This reduces package size for CI environments, since not every time all of the models will be used. Depending on what tools you need to use, you might want to do: or : Installs only the minimum required dependencies to run SAMGeo : Installs the dependencies to run SAMGeo 2 : Installs the dependencies to run SAMGeo 3 : Installs the dependencies to run Fast SAM : Installs the dependencies to run HQ-SAM : Installs Grounding

DINO to use SAMGeo 1 and 2 with text prompts : Installs the dependencies to run the feature : Installs FastAPI and Uvicorn for serving segmentation as a REST API Additionally, these other two optional imports are defined: : Installs the dependencies to run all of the SAMGeo models : Installs the dependencies to run all of the SAMGeo models and other utilities to run the examples like Jupyter notebook support, , etc. Simply running the following should install the dependencies for each use case

: To see more in detail what packages come with each choice, please refer to . Install from conda-forge **segment-geospatial

常见问题

记录了多少星标和分叉?

opengeos/segment-geospatial 有 4,165 个星标和 447 个分叉。

仓库排名是多少?

opengeos/segment-geospatial 排名第 4,724。

记录的语言和类别是什么?

opengeos/segment-geospatial 有 4,165 个星标,语言为 Python,类别为 AI Engineering。

哪个仓库排名最接近?

opengeos/segment-geospatial 与 ai-robots-txt/ai.robots.txt 比较,后者排名第 4,723,有 4,195 个星标。

README

SamGeo

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

Introduction

The SamGeo package draws its inspiration from segment-anything-eo repository authored by Aliaksandr Hancharenka. The primary objective of SamGeo is to simplify the process of leveraging SAM for geospatial data analysis by enabling users to achieve this with minimal coding effort. The source code of SamGeo was adapted from the segment-anything-eo repository, and credit for its original version goes to Aliaksandr Hancharenka.

  • Free software: MIT license
  • Documentation:

Citations

  • Wu, Q., & Osco, L. (2023). samgeo: A Python package for segmenting geospatial data with the Segment Anything Model (SAM). Journal of Open Source Software, 8(89), 5663.
  • Osco, L. P., Wu, Q., de Lemos, E. L., Gonçalves, W. N., Ramos, A. P. M., Li, J., & Junior, J. M. (2023). The Segment Anything Model (SAM) for remote sensing applications: From zero to one shot. International Journal of Applied Earth Observation and Geoinformation, 124, 103540.

Features

  • Download map tiles from Tile Map Service (TMS) servers and create GeoTIFF files
  • Segment GeoTIFF files using the Segment Anything Model (SAM) and HQ-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
  • Segment objects from timeseries remote sensing imagery
  • REST API for serving segmentation over HTTP (see API docs)

QGIS Plugin

SamGeo is also available as a QGIS plugin. Check out this short video demo and full video tutorial on how to use the plugin.

Installation

Install with pixi (Recommended)

For the most reliable installation experience, especially on Windows or when dealing with complex dependencies like PyTorch/CUDA and SAM 3, we recommend using pixi. Pixi provides faster and more reliable dependency resolution than conda/mamba and avoids common numpy version conflicts. See the full pixi installation guide for detailed instructions.

Quick start with pixi:

# Install pixi (Linux/macOS)
curl -fsSL https://pixi.sh/install.sh | sh

# Or on Windows (PowerShell)
powershell -ExecutionPolicy Bypass -c "irm -useb https://pixi.sh/install.ps1 | iex"

# Create a new pixi project
pixi init geo
cd geo

# Edit pixi.toml with your configuration (see docs for GPU/CPU examples)
# Then install
pixi install

# Start Jupyter Lab
pixi run jupyter lab

Install from PyPI

segment-geospatial is available on PyPI and can be installed in several ways so that its dependencies can be controlled more granularly. This reduces package size for CI environments, since not every time all of the models will be used.

Depending on what tools you need to use, you might want to do:

  • segment-geospatial or segment-geospatial[samgeo]: Installs only the minimum required dependencies to run SAMGeo
  • segment-geospatial[samgeo2]: Installs the dependencies to run SAMGeo 2
  • segment-geospatial[samgeo3]: Installs the dependencies to run SAMGeo 3
  • segment-geospatial[fast]: Installs the dependencies to run Fast SAM
  • segment-geospatial[hq]: Installs the dependencies to run HQ-SAM
  • segment-geospatial[text]: Installs Grounding DINO to use SAMGeo 1 and 2 with text prompts
  • segment-geospatial[fer]: Installs the dependencies to run the feature edge reconstruction algorithm
  • segment-geospatial[api]: Installs FastAPI and Uvicorn for serving segmentation as a REST API

Additionally, these other two optional imports are defined:

  • segment-geospatial[all]: Installs the dependencies to run all of the SAMGeo models
  • segment-geospatial[extra]: Installs the dependencies to run all of the SAMGeo models and other utilities to run the examples like Jupyter notebook support, leafmap, etc.

Simply running the following should install the dependencies for each use case:

pip install "segment-geospatial[samgeo3]" # Or any other choice of the above

To see more in detail what packages come with each choice, please refer to pyproject.toml.

Install from conda-forge

segment-geospatial is also available on conda-forge. If you have Anaconda or Miniconda installed on your computer, you can install segment-geospatial using the following commands. It is recommended to create a fresh conda environment for segment-geospatial. The following commands will create a new conda environment named geo and install segment-geospatial and its dependencies:

conda create -n geo python
conda activate geo
conda install -c conda-forge segment-geospatial

If your system has a GPU, but the above commands do not install the GPU version of pytorch, you can force the installation of the GPU version of pytorch using the following command:

conda install -c conda-forge segment-geospatial "pytorch=*=cuda*"

segment-geospatial has some optional dependencies that are not included in the default conda environment. To install these dependencies, run the following command:

conda install -c conda-forge groundingdino-py segment-anything-fast

Install SAM 3 on Windows

It is a bit tricky to install SAM 3 on Windows. Run the following commands on Windows to install SamGeo:

conda create -n geo python=3.12
conda activate geo
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia
pip install "segment-geospatial[samgeo3]"
pip install triton-windows ipykernel jupyterlab

Examples

Demos

  • Automatic mask generator

  • Interactive segmentation with input prompts

  • Input prompts from existing files

  • Interactive segmentation with text prompts

Tutorials

Video tutorials are available on my YouTube Channel.

  • Automatic mask generation

  • Using SAM with ArcGIS Pro

  • Interactive segmentation with text prompts

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.

Legal Notice

This repository and its content are provided for educational purposes only. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations. Users who intend to download a large number of image tiles from any basemap are advised to contact the basemap provider to obtain permission before doing so. Unauthorized use of the basemap or any of its components may be a violation of copyright laws or other applicable laws and regulations.

Contributing

Please refer to the contributing guidelines for more information.

Acknowledgements

This project is based upon work partially supported by the National Aeronautics and Space Administration (NASA) under Grant No. 80NSSC22K1742 issued through the Open Source Tools, Frameworks, and Libraries 2020 Program.

This project is also supported by Amazon Web Services (AWS). In addition, this package was made possible by the following open source projects. Credit goes to the developers of these projects.

排名相邻
同类项目