A PyTorch domain library providing datasets, samplers, transforms, and pre-trained models for geospatial and remote sensing data.
opengeos/segment-geospatial
A Python package that applies Meta's Segment Anything Model (SAM) to geospatial imagery such as satellite and aerial photos, producing georeferenced masks.
- Stars
- 4,200
- Forks
- 451
- Open issues
- 8
- Last commit
- 4 days ago
What is it?
SamGeo is a Python package that makes the Segment Anything Model usable on geospatial data with minimal code. It can download map tiles from Tile Map Service (TMS) servers and convert them to GeoTIFF files, then segment those rasters with SAM or HQ-SAM. Users can place foreground and background point prompts interactively, load prompts from vector files, or segment imagery with text prompts.
Results can be exported as GeoPackage, Shapefile, or GeoJSON, and prompts can be saved as GeoJSON. The package also supports segmenting timeseries remote sensing imagery and visualizing outputs on interactive maps. A REST API is available for serving segmentation over HTTP as an optional install.
SamGeo is also available as a QGIS plugin, and the project provides example notebooks for Jupyter, Google Colab, and ArcGIS Pro. It is installable from PyPI, conda-forge, or pixi, with separate optional extras for different SAM variants.
Key features
- 01Downloads TMS map tiles and creates GeoTIFF files
- 02Segments rasters with SAM and HQ-SAM
- 03Supports text prompts for remote sensing imagery
- 04Interactive foreground and background point markers
- 05Exports results to GeoPackage, Shapefile, and GeoJSON
- 06Provides a REST API for serving segmentation over HTTP
Use cases
- Extracting buildings, pools, or other objects from satellite imagery
- Batch segmenting timeseries remote sensing data to track land change
- Creating vector masks for GIS workflows in QGIS or ArcGIS Pro
- Running segmentation as a web service on a GPU server
Quick start
- 1
Install segment-geospatial from PyPI with minimal dependencies
pip install segment-geospatial
Things to know
- A powerful GPU with at least 8 GB of GPU memory is recommended for large datasets.
- Installing SAM 3 on Windows is tricky and needs extra steps.
- Heavy dependencies such as PyTorch and CUDA make setup more involved.
- Users who download many tiles from a basemap should get the provider's permission first.
In collections
Topics
FAQ
- What is segment-geospatial?
- A Python package that applies Meta's Segment Anything Model (SAM) to geospatial imagery such as satellite and aerial photos, producing georeferenced masks. SamGeo is a Python package that makes the Segment Anything Model usable on geospatial data with minimal code. It can download map tiles from Tile Map Service (TMS) servers and convert them to GeoTIFF files, then segment those rasters with SAM or HQ-SAM. Users can place foreground and background point prompts interactively, load prompts from vector files, or segment imagery with text prompts.
- Is segment-geospatial free to use? What license does it have?
- segment-geospatial is open source under the MIT license. Check the license terms before using it in commercial products.
- Is segment-geospatial still maintained?
- Actively maintained. The last commit to segment-geospatial was on Nov 3, 2026.
- What can I use segment-geospatial for?
- Extracting buildings, pools, or other objects from satellite imagery Batch segmenting timeseries remote sensing data to track land change Creating vector masks for GIS workflows in QGIS or ArcGIS Pro Running segmentation as a web service on a GPU server
- How do I install segment-geospatial?
- Install segment-geospatial from PyPI with minimal dependencies: pip install segment-geospatial
- Where can I get segment-geospatial?
- The source code and installation instructions are on GitHub: https://github.com/opengeos/segment-geospatial
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Python package for interactive geospatial analysis and visualization of Google Earth Engine data in Jupyter notebooks.
A desktop and web GIS written in pure Rust for mapping, analyzing and sharing geospatial data, with scriptable commands and an AI assistant.
A differentiable computer vision library built on PyTorch, offering GPU-friendly image processing, geometry, augmentation and feature-matching operators.
Python framework for building modular workflows that process satellite Earth observation imagery into machine learning inputs.
Python library for image augmentation in computer vision, covering pixel, spatial, medical and 3D transforms with consistent handling of masks, boxes and keypoints.