Skip to content
Back to skills

Segment Geospatial

ASecurity

"Guides segment-geospatial/SamGeo workflows for geospatial SAM

  • 247 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 9, 2026
developmentpythonbashfastapiapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill segment-geospatial --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Segment Geospatial?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Segment Geospatial
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-segment-geospatial/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-segment-geospatial)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: segment-geospatial
description: "Guides segment-geospatial/SamGeo workflows for geospatial SAM
  segmentation, SAM2/SAM3 model variants, REST API serving, raster/vector IO,
  and optional text or caption model integrations."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# segment-geospatial (SamGeo)

Use this repo skill when a task involves the `segment-geospatial` package, the
`samgeo` Python import, or geospatial image segmentation with SAM-family models.
It is self-contained operating guidance distilled from package code, docs,
examples, tests, and installed-package inspection for version 1.4.1.

## First choose the route

| User task | Read |
| --- | --- |
| Segment a GeoTIFF or image with SAM1/SAM2, automatic masks, point prompts, box prompts, or SAM2 video | [core-segmentation](sub-skills/core-segmentation/SKILL.md) |
| Use SAM3/SAM3.1, text prompts, point/box instance prompts, tiled large-image segmentation, batch images, or SAM3 video tracking | [samgeo3-workflows](sub-skills/samgeo3-workflows/SKILL.md) |
| Download map tiles, handle CRS, prepare multi-band imagery, convert raster masks to vectors, split/merge rasters, inspect raster metadata, or use UTM helpers | [geospatial-utilities](sub-skills/geospatial-utilities/SKILL.md) |
| Use FastSAM, HQ-SAM, LangSAM/GroundingDINO text prompts, BLIP image captioning, or optional detectree2/FER notes | [specialized-models](sub-skills/specialized-models/SKILL.md) |
| Serve segmentation over HTTP, call `samgeo-api`, validate API parameters, handle output formats, or troubleshoot model/image caches | [api-server](sub-skills/api-server/SKILL.md) |

Read [model-and-workflow-overview.md](references/model-and-workflow-overview.md)
for the package map and [installation-and-dependencies.md](references/installation-and-dependencies.md)
before choosing extras or CUDA packages. Read [troubleshooting.md](references/troubleshooting.md)
for cross-cutting install, GPU, model-download, CRS, and optional-dependency failures.

## Minimal install and import checks

Use a fresh environment. Python 3.10-3.12 is exercised by the repository CI;
Python 3.11 is a safe default for ML/geospatial dependencies.

```bash
pip install "segment-geospatial[samgeo2,samgeo3,fast,hq,text,api]"
python - <<'PY'
import samgeo
from samgeo.model_registry import AVAILABLE_MODELS
print(samgeo.__version__)
print(AVAILABLE_MODELS)
PY
```

For SAM3 runtime work, verify CUDA before promising a run:

```python
import torch
print(torch.__version__, torch.version.cuda)
print(torch.cuda.is_available(), torch.cuda.device_count())
```

Run the bundled safe diagnostic when an environment looks questionable:

```bash
python scripts/check_install.py --check-optional
python scripts/check_install.py --require-cuda
```

The scripts only import modules and inspect lightweight API state; they do not
download model weights or start a service.

## Package entry points and outputs

- Python import: `samgeo`.
- Distribution: `segment-geospatial`.
- CLI entry point: `samgeo-api` for the FastAPI service.
- Main classes: `SamGeo`, `SamGeo2`, `SamGeo3`, `SamGeo3Video`, `LangSAM`,
  FastSAM/HQ-SAM wrappers, and `ImageCaptioner`.
- Typical inputs: GeoTIFF, PNG/JPEG, NumPy arrays, URLs, point coordinates,
  bounding boxes, GeoJSON/vector prompts, and videos/time-series frames.
- Typical outputs: mask GeoTIFF/PNG, vector GeoPackage/Shapefile/GeoJSON,
  JSON/detections from the API, caption/feature lists, and blended videos.

## Operating rules

- Do not tell users to open notebooks, scripts, tests, or docs from the original
  checkout. Use the bundled references and scripts in this skill.
- Distinguish pixel coordinates from geographic coordinates. If points or boxes
  are in a CRS, pass `point_crs` or `box_crs` where the selected API supports it.
- SamGeo preserves the source raster CRS during segmentation; it does not
  automatically reproject masks to EPSG:4326.
- SAM3/SAM3.1 guidance should be treated as CUDA-backed unless the task is only
  inspecting imports or mock-backed tests. CPU import checks are not proof of
  real SAM3 runtime capability.
- Model-weight downloads, Hugging Face authentication, map-tile downloads,
  long-running inference, notebooks, QGIS plugin operations, and detectree2 or
  GDAL-specific paths require explicit user/environment readiness.
- The user requested `not import` for this generated skill run; do not run the
  repo-skill import helper unless a later instruction explicitly approves it.

## Provenance and refresh

Read [repo-provenance.md](references/repo-provenance.md) before deciding this
skill matches a new checkout. If the commit, package version, public APIs, or
major example/test paths differ, refresh the skill before relying on stale
routing or API details.

Files in this skill

  • SKILL.md4.7 KB
  • references/installation-and-dependencies.md5.3 KB
  • references/model-and-workflow-overview.md5 KB
  • references/repo-provenance.md2.3 KB
  • references/repo-routing-metadata.json508 B
  • references/troubleshooting.md5.9 KB
  • scripts/check_install.py5.8 KB
  • sub-skills/api-server/SKILL.md2.6 KB
  • sub-skills/api-server/references/api-reference.md3.6 KB
  • sub-skills/api-server/references/troubleshooting.md2.1 KB
  • sub-skills/api-server/references/workflows.md2.2 KB
  • sub-skills/api-server/scripts/api_smoke.py2.1 KB
  • sub-skills/core-segmentation/SKILL.md3.9 KB
  • sub-skills/core-segmentation/references/api-reference.md4.4 KB
  • sub-skills/core-segmentation/references/troubleshooting.md2.2 KB
  • sub-skills/core-segmentation/references/workflows.md3.6 KB
  • sub-skills/core-segmentation/scripts/core_smoke.py1.9 KB
  • sub-skills/geospatial-utilities/SKILL.md2.9 KB
  • sub-skills/geospatial-utilities/references/api-reference.md4.6 KB
  • sub-skills/geospatial-utilities/references/troubleshooting.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.