How opengeos/segment-geospatial works
SamGeo is a geospatial image-segmentation product exposed through a Python library, a Click CLI, a REST API, and a QGIS plugin. The main workflow is to supply imagery and prompts or select automatic segmentation, run a SAM-family model, then save or visualize raster/vector results. The graph also preserves documented tile download, text prompting, time-series/video, and plugin-installation capabilities. Some feature branches are documented but not fully sampled; those links are omitted rather than inferred from names alone.
Main entry points: samgeo_backend.py Model Backend · samgeo_cli.py CLI · api.py REST API · common.py Geospatial Utilities
Components 27
Segmentation Workflow
- Project State
agent-harness/cli_anything/samgeo/core/project.py - Session History
agent-harness/cli_anything/samgeo/core/session.py - Raster Data
agent-harness/cli_anything/samgeo/core/data.py - Prompted Segmentation
agent-harness/cli_anything/samgeo/core/segment.py - Vector Data
agent-harness/cli_anything/samgeo/core/vector.py - Result Export
agent-harness/cli_anything/samgeo/core/export.py - Geospatial Utilities
samgeo/common.py
Model Backends
- Model Backend
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - SAM
samgeo/samgeo.py - SAM 2
samgeo/samgeo2.py - SAM 3
samgeo/samgeo3.py - Fast SAM
samgeo/fast_sam.py - HQ-SAM
samgeo/hq_sam.py - Text Prompts
samgeo/text_sam.py - Model Registry
samgeo/model_registry.py
QGIS Plugin
- QGIS Interface
qgis-samgeo-plugin/samgeo_plugin.py - Dependency Setup
qgis-samgeo-plugin/core/venv_manager.py - Python Manager
qgis-samgeo-plugin/core/python_manager.py - UV Manager
qgis-samgeo-plugin/core/uv_manager.py - Install Worker
qgis-samgeo-plugin/workers/deps_install_worker.py - Install Dialog
qgis-samgeo-plugin/deps_install_dialog.py - Map Tools
qgis-samgeo-plugin/map_tools.py
Other components
- User
- TMS Service
- Geospatial Files
Connections 44
- User → CLI: runs commands
README.md - User → REST API: sends requests
README.md - User → QGIS Interface: uses plugin
README.md - CLI → Project State: manages projects
agent-harness/cli_anything/samgeo/samgeo_cli.py - CLI → Session History: uses sessions
agent-harness/cli_anything/samgeo/samgeo_cli.py - CLI → Raster Data: calls data tools
agent-harness/cli_anything/samgeo/samgeo_cli.py - CLI → Prompted Segmentation: runs segmentation
agent-harness/cli_anything/samgeo/samgeo_cli.py - CLI → Vector Data: calls vector tools
agent-harness/cli_anything/samgeo/samgeo_cli.py - CLI → Result Export: exports results
agent-harness/cli_anything/samgeo/samgeo_cli.py - Prompted Segmentation → Project State: updates state
agent-harness/cli_anything/samgeo/core/segment.py - Prompted Segmentation → Model Backend: creates model
agent-harness/cli_anything/samgeo/core/segment.py - Raster Data → Model Backend: uses utilities
agent-harness/cli_anything/samgeo/core/data.py - Vector Data → Model Backend: uses utilities
agent-harness/cli_anything/samgeo/core/vector.py - Result Export → Project State: reads project
agent-harness/cli_anything/samgeo/core/export.py - Result Export → Model Backend: uses utilities
agent-harness/cli_anything/samgeo/core/export.py - Raster Data → Geospatial Files: reads and writes
README.md - Result Export → Geospatial Files: writes results
README.md - Raster Data → TMS Service: downloads tiles
README.md - Model Backend → SAM: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - Model Backend → SAM 2: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - Model Backend → SAM 3: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - Model Backend → Fast SAM: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - Model Backend → HQ-SAM: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - Model Backend → Text Prompts: instantiates
agent-harness/cli_anything/samgeo/utils/samgeo_backend.py - SAM → Geospatial Utilities: uses utilities
samgeo/samgeo.py - SAM 2 → Geospatial Utilities: uses utilities
samgeo/samgeo2.py - SAM 3 → Geospatial Utilities: uses utilities
samgeo/samgeo3.py - Fast SAM → Geospatial Utilities: uses utilities
samgeo/fast_sam.py - HQ-SAM → Geospatial Utilities: uses utilities
samgeo/hq_sam.py - Text Prompts → Geospatial Utilities: uses utilities
samgeo/text_sam.py - Text Prompts → SAM 2: uses model
samgeo/text_sam.py - REST API → SAM: routes inference
samgeo/api.py - REST API → SAM 2: routes inference
samgeo/api.py - REST API → SAM 3: routes inference
samgeo/api.py - REST API → Model Registry: uses registry
samgeo/api.py - REST API → Geospatial Utilities: uses utilities
samgeo/api.py - QGIS Interface → Map Tools: uses tools
qgis-samgeo-plugin/samgeo_plugin.py - QGIS Interface → Dependency Setup: manages dependencies
qgis-samgeo-plugin/samgeo_plugin.py - QGIS Interface → Install Dialog: opens dialog
qgis-samgeo-plugin/samgeo_plugin.py - QGIS Interface → Install Worker: starts worker
qgis-samgeo-plugin/samgeo_plugin.py - Install Dialog → QGIS Interface: signals requests
qgis-samgeo-plugin/samgeo_plugin.py - Install Worker → Dependency Setup: runs installation
qgis-samgeo-plugin/workers/deps_install_worker.py - Dependency Setup → Python Manager: uses manager
qgis-samgeo-plugin/core/venv_manager.py - Dependency Setup → UV Manager: uses manager
qgis-samgeo-plugin/core/venv_manager.py