Skip to content
Back to skills

Sam2 Boundaries

ASecurity

Zero-shot field boundaries with SAM2: tiled inference, seam stitching, cleanup, GeoJSON, alignment.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 19, 2026
ai-agentsgo

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add Adilmunawar/ZD-claude-plugin --skill sam2-boundaries --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sam2 Boundaries?

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

Security grade badge for Sam2 Boundaries
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adilmunawar-sam2-boundaries/badge)](https://www.skillsdirectory.com/skills/adilmunawar-sam2-boundaries)

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: sam2-boundaries
paths: ["**/SAM*/**", "**/*sam*.py"]
description: Zero-shot field boundaries with SAM2: tiled inference, seam stitching, cleanup, GeoJSON, alignment.
---

Constants: `TILE_SIZE=1024`, `STRIDE=512`, `POINTS_PER_SIDE=32`, `POINTS_PER_BATCH=64`, `PRED_IOU_THRESH=0.80–0.88`, `STABILITY_SCORE_THRESH=0.82–0.90`, `MIN_MASK_REGION_AREA=50–200`, `EROSION_KERNEL=(3,3)`, `MIN_FIELD_AREA_PX=300`, `MAX_FIELD_AREA_PX=2e6`, stitching `STITCH_BAND=32 px`, `STITCH_MIN_TOUCH=12 px`, `STITCH_COLOR_THRESH=20 ΔE`.

1. Imagery: XYZ tiles at zoom 19 mosaicked to GeoTIFF in EPSG:3857 (same fetcher as `boundary-inference`).
2. Tiled AMG with overlap; masks get global ids via a union-find; masks crossing a seam merge only if they touch ≥ `STITCH_MIN_TOUCH` px and mean LAB colour difference < `STITCH_COLOR_THRESH`.
3. Cleanup: erosion, area filter, fill holes, smooth (`zd-vector:topology-repair`), then polygonise to GeoJSON.
4. Optional alignment: snap SAM polygons to an existing boundary layer within a tolerance; report matched / unmatched counts.
5. Scoring for a target crop: spectral filter (`spectral-features`) with a probability threshold (`0.40`) → `fields_scored.geojson`.

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…