OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

SamGeo

SamGeo is a Python package that applies the Segment Anything Model to geospatial data, with a QGIS plugin option for using the package in that GIS application.

Independent OpenViST project profile, based on linked sources.

SamGeo — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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
Before you choose

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.

Source-based practical guide

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

  1. Install or upgrade the geospatial integration with the command below.

    Documented command
    pip install --upgrade segment-geospatial "segment-anything-fast[geo]>=0.1.3" "setuptools<81"
  2. In the script, import SamGeo from samgeo_fastsam and initialize it with a FastSAM model such as FastSAM-x.pt.

  3. Load the image with set_image("image.tif", device="cpu").

  4. 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=1 is 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_sam are not migrated.
Evidence and transparency

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