Practical overview
When it fits
Use SamGeo when a geospatial workflow needs image segmentation with SAM and the intended working environment is Python or QGIS. For FastSAM specifically, follow the separate integration instructions rather than assuming it is bundled with SamGeo.
Who it is for
- Python developers building geospatial image-segmentation workflows
- GIS practitioners who want to use SamGeo through QGIS
- Teams prototyping minimal-code interfaces for geospatial segmentation
Documented uses
- Apply SAM to geospatial data in a Python workflow
- Use SamGeo within QGIS for geospatial segmentation
- Prototype a minimal-code interface for segmenting geospatial data
Requirements & limits
- Choose between the Python package and QGIS plugin according to where the geospatial workflow will be built.
- FastSAM is now a separately installed integration, not a SamGeo extra.
- FastSAM setup has version-sensitive dependencies and a documented checkpoint-loading caveat.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the documented FastSAM geospatial integration
Install the separate FastSAM integration and prepare a Python workflow that loads an image and requests segmentation masks.
Before you start
- Python 3.10 or later
- A Python environment where the listed packages can be installed
- A geospatial image file
- A FastSAM checkpoint downloaded separately
Steps
Install or upgrade the geospatial integration with the command below.
pip install --upgrade segment-geospatial "segment-anything-fast[geo]>=0.1.3" "setuptools<81"In the script, import
SamGeofromsamgeo_fastsamand initialize it with a FastSAM model such asFastSAM-x.pt.Load the image with
set_image("image.tif", device="cpu").Call
everything_prompt(output="masks.tif")to request mask output.
Expected outcome
A Python FastSAM workflow that loads a geospatial image and requests segmentation masks.
Guide limitations
- FastSAM checkpoints are separate downloads.
- With Torch 2.6 or later, loading FastSAM-x.pt may fail unless
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1is set before Python starts. The documentation warns that this disables the weights-only safety check and should be used only with trusted checkpoints. - The agent CLI does not support this FastSAM integration.
- Existing environments need the updated package and import path; serialized objects referring to
samgeo.fast_samare not migrated.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 28 November 2026
- Original website title
- Home - segment-geospatial · Official homepage title · retained in its source language

