Geo-SAM

coolzhaoMIT更新放缓

QGIS 插件,用 Segment Anything Model 在地理栅格影像上快速分割和勾绘地貌,省去手工描边的麻烦。

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.

v2.0发布于 2026-06-22 07:06 UTC433star56fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
在 QGIS 插件管理器中搜索 "Geo SAM" 并安装;随后在 Geo-SAM Settings > Dependencies > Install Missing 安装依赖,重启 QGIS 后在 Model Management 中下载模型
硬件要求按 README 说明

README 未说明具体显存或 GPU 型号要求,仅提到交互式分割可在笔记本 CPU 上以毫秒级速度运行。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

QGIS 插件,用 SAM 系列模型在遥感栅格影像上快速勾画地物

QGIS 插件,用 Segment Anything Model 在地理栅格影像上快速分割和勾绘地貌,省去手工描边的麻烦。

核心能力

  • 预编码影像特征后毫秒级响应交互式分割
  • 提供实时编码与预编码两种分割工作流
  • 支持 SAM、SAM 2、SAM 2.1、SAM 3 模型家族
  • 插件内一键安装依赖并管理模型下载
  • 支持 XYZ/WMS 在线瓦片图层直接分割

容易踩的坑

安装插件后需在设置中单独安装依赖并重启 QGIS;需在 Model Management 中额外下载 SAM 模型才能使用;预编码模式需先用 Image Encoder 生成特征文件

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.0
  1. v2.0最新正式版2026-06-22 · 2026-06-22 07:06 UTC

    Geo-SAM v2.0

    A ground-up rewrite of the Geo-SAM QGIS plugin, built on the new geosam core library with the Ultralytics SAM backend.

    🏗️ Architecture

    • Full backend rewrite — replaced in-plugin SAM implementation with the geosam core library
    • SAM backend switched to Ultralytics — model loading and inference now use the ultralytics SAM stack
    • Plugin-managed dependencies & models — one-click install/download, no manual pip or file management

    ✨ New Features

    • Live Encoding mode — segment directly from a raster layer without pre-encoding; features are encoded on the fly via QGIS background tasks and cached for fast re-queries
    • Pre-encoded mode — use Image Encoder to generate reusable feature files for repeated segmentation of the same image
    • Online tile layer support — XYZ, WMS, and WMTS tile layers can be used in live-encoding mode (supports arbitrary WMTS CRS)
    • SAM2 and SAM3 model support — added SAM2, SAM2.1, and SAM3 model families alongside the original SAM
    • Vectorization mode — choose between Pixel-Level and Simplified polygon output
    • Max Polygon Only mode — keep only the largest polygon from the current mask
    • Unified Settings dialog — four tabs (Dependencies, Model Management, Cache, Help)
    • In-app Model Management — download, delete, and unload SAM checkpoints with Ultralytics + ModelScope fallback
    • Feature cache management — configurable cache directory, maximum size, performance mode (Balanced / Fastest / Low Memory)
    • Split-panel UI — Segmentation dock widget with Input/Output + Prompts on the left, Styles + Options on the right
    • Multi-language UI — 中文, 日本語, 한국어, Français, Русский, العربية, Deutsch, Español, Português
    • Selectable realtime performance modes and async preview pipeline

    🔧 Improvements

    • PyQt6 / QGIS 4 compatibility
    • Faster prompt response via feature cache reuse
    • Better memory management (Balanced vs Low Memory strategies)
    • Preserved polygon holes when saving SAM results
    • Tab key cycles prompt types; keyboard shortcuts work even when widget is not focused
    • Preview Mode — SAM predictions follow the mouse cursor in real time
    • Lazy-load Geo-SAM runtime dependencies for faster plugin startup
    • Improved dependency settings UI with install progress feedback
    • Backend abstraction layer for QGIS integration

    🗑️ Removed

    • torchgeo and segment_anything as runtime dependencies (replaced by geosam + ultralytics)
    • Minimum Pixels parameter from the Segmentation tool UI
    • Load Demo option
    • Manual pip dependency installation (replaced by Settings dialog)

    🐛 Bug Fixes

    • Fixed polygon holes not preserved when saving SAM results
    • Fixed SAM3 model image size handling
    • Fixed preview mode defaults and setting changes not persisting
    • Fixed online raster cache reuse across models
    • Fixed Windows QGIS Python interpreter resolution for dependency install
    • Fixed Conda QGIS runtime missing rasterio, geopandas, shapely, pyproj
    • Fixed crash on open widget due to tab key looping
    • Fixed second point not working in prompt
    • Fixed CRS comparison issues in realtime cache
    • Fixed user.json creation when file doesn't exist

    📦 Dependencies

    • New: geosam core library
    • New: ultralytics for SAM model inference
    • Removed: torchgeo, segment_anything

    Full Changelog: https://github.com/coolzhao/Geo-SAM/compare/v1.3.2...v2.0

  2. v1.3.2v1.3.2(stable)2025-05-19 · 2025-05-19 03:30 UTC
    查看更新说明

    Release 1.3.2 (stable)

    What's New:

    • Added two dedicated button for users to create or load the SAM output layer.
    • Added more SAM output layer formats.

    What's Fixed:

    Full Changelog: https://github.com/coolzhao/Geo-SAM/compare/1.2.0...v1.3.2

    [!NOTE]

    • For first time installation, you need to download the compressed source code file.
    • For updating, we recommend downloading the zipped file labeled *_code_update.zip, which contains only the updated code.
  3. v1.3.1-rc32024-12-24 · 2024-12-24 01:48 UTC
    查看更新说明

    Release 1.3.1 RC3 - Key Updates:

    Fix: Addressed issue of "QgsField Type Error": https://github.com/coolzhao/Geo-SAM/discussions/59 https://github.com/coolzhao/Geo-SAM/issues/60

    [!NOTE]

    • For first time installation, you need to download the compressed source code file.
    • For updating, we recommend downloading the zipped file labeled *_code_update.zip, which contains only the updated code.
  4. v1.3.1-rc22024-12-17 · 2024-12-17 07:07 UTC
    查看更新说明

    Release 1.3.1 RC2 - Key Updates:

    For updating, we recommend downloading the zipped file labeled *_code_update.zip, which contains only the updated code.

  5. v1.3-rc2024-05-19 · 2024-05-19 08:41 UTC
    查看更新说明

    This release is the 1.3RC (Release Candidate) version, featuring the following key updates:

    1. The plugin's interface has been optimized by changing two lines into one, thereby reducing its occupied space. https://github.com/coolzhao/Geo-SAM/issues/26
    2. Multiple bugs have been addressed and resolved. https://github.com/coolzhao/Geo-SAM/issues/39, https://github.com/coolzhao/Geo-SAM/issues/42, https://github.com/coolzhao/Geo-SAM/issues/43.
    3. Add a *_code_update.zip file in the release. This file only contains the code portion, which greatly reduces the file size and can significantly reduce the download time for users who only need to update the code.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Geo SAM

    🎉 GeoSAM is now on the QGIS Official Plugin Repository! Install and update Geo-SAM directly from the QGIS Plugin Manager -- Plugins > Manage and Install Plugins, search for "Geo SAM", and click Install. No manual download needed.

    By Zhuoyi Zhao (Joey) and Chengyan Fan (Fancy) from Cryosphere Lab, ESSC, CUHK.

    Introduction

    Geo-SAM is a QGIS plugin that helps you segment, delineate, and label landforms efficiently in large geospatial raster images. It is built on the Segment Anything Model (SAM) and uses the strategies of encoding image features in advance and stripping the heavy image encoder from inference. The interactive segmentation runs at millisecond speeds on a laptop CPU, making it a convenient and efficient tool for remote sensing image analysis.

    Since v2.0, Geo-SAM provides two segmentation workflows:

    • Live Encoding mode -- select a raster layer and a SAM model, then start segmenting. Features are encoded on the fly using QGIS background tasks and cached for fast re-queries. No pre-encoding required.
    • Pre-encoded mode -- use the Image Encoder to generate reusable feature files, then load them in the Segmentation tool. Best for repeated segmentation of the same image.
    Comparison of the workflow between Geo-SAM and the original SAM
    Comparison of the workflow between Geo-SAM and the original SAM. The original SAM encodes prompts and image simultaneously, while Geo-SAM encodes image features in advance and queries prompts at millisecond speeds by loading saved features.

    What's New in GeoSAM v2.0

    • Live Encoding mode -- no pre-encoding needed for quick exploration.
    • geosam core library backbone -- replaces the internal implementation with a dedicated geospatial SAM library.
    • SAM3 model support -- SAM, SAM 2, SAM 2.1, and SAM 3 model families.
    • Plugin-managed dependencies -- one-click dependency installation into an isolated, plugin-private directory. No manual pip commands.
    • Unified Settings dialog -- Dependencies, Model Management, Cache, and Help in one place.
    • Online tile layer support -- segment directly from XYZ/WMS tile layers.
    • Vectorization modes -- Pixel-Level or Simplified polygon output.
    • Max Polygon Only mode -- keep only the largest polygon from each mask.
    • Split-panel UI -- cleaner layout with Input/Output + Prompts on the left, Styles + Options on the right.
    • Async preview pipeline -- smoother preview as you move the mouse.
    • Multi-language UI -- the interface is translated into 中文, 日本語, 한국어, Français, Русский, العربية, Deutsch, Español, and Português, following the QGIS locale setting automatically.

    See the changelog for the full list of changes.

    Installation and Usage

    Read the documentation for more details: https://geo-sam.readthedocs.io/en/latest/.

    Quick start:

    1. Install the Geo-SAM plugin from the QGIS Plugin Manager.
    2. Open Geo-SAM Settings > Dependencies > Install Missing.
    3. Restart QGIS.
    4. Open Geo-SAM Settings > Model Management > download a model (e.g., SAM2.1 Base).
    5. Click the Geo-SAM Segmentation icon, select an image layer and model, and start labelling.

    See the Quick Start guide for a 5-minute walkthrough.

    Demos

    • Live Encoding Demo (millisecond-level response time after providing prompts)
    • Image Encoder Demo (Old version, still available in the "Pre-encoded mode" since Geo-SAM v2.0)
    • Encoder Copilot Demo

    Citation

    Zhao, Zhuoyi, Fan, Chengyan, & Liu, Lin. (2023). Geo SAM: A QGIS plugin using Segment Anything Model (SAM) to accelerate geospatial image segmentation (1.0). Zenodo. https://doi.org/10.5281/zenodo.8191039

    @software{zhao_zhuoyi_2023_8191039,
      author       = {Zhao, Zhuoyi and Fan, Chengyan and Liu, Lin},
      title        = {{Geo SAM: A QGIS plugin using Segment Anything Model (SAM) to accelerate geospatial image segmentation}},
      year         = 2023,
      publisher    = {Zenodo},
      version      = {1.0},
      doi          = {10.5281/zenodo.8191039},
      url          = {https://doi.org/10.5281/zenodo.8191039}
    }
    

    Acknowledgement

    This repo benefits from Segment Anything, SAM 2, Ultralytics, geosam, and QGIS. Thanks for their wonderful work.