adilmunawar/zd-claude-plugin/boundary-inference
Claude Code and agent skill by adilmunawar/zd-claude-plugin
- community
Checking that the SKILL.md file is still in the repository.
Chunked low-RAM boundary model inference over an AOI from XYZ tiles: tile cache, patch scan, Hanning blending, hysteresis, merged COG.
Install
npx vskill@latest install adilmunawar/zd-claude-plugin/boundary-inferenceSKILL.md
The same SKILL.md was published earlier as adilmunawar/zd-claude-plugin/boundary-inference.
Boundary inference over an AOI
Reference constants (adjust per model; record any change): ZOOM=19, TILE_SIZE=256, CHUNK_SIZE_M=5000, PATCH_SIZE=512, OVERLAP=256, PROCESS_BLOCK=1024, GPU_BATCH=8, THRESHOLD=0.55, hysteresis HYST_LOW=0.35, encoder tu-hrnet_w48 (segmentation_models_pytorch U-Net).
Stages
- AOI → chunks. Read the AOI GeoJSON, reproject to EPSG:3857, split into
CHUNK_SIZE_Msquares. One output folder per chunk; skip chunks whoseprediction.tifalready exists (resume). - Tile fetch.
mercantile.tiles(bbox, ZOOM); download in batches (DOWNLOAD_BATCH_SIZE) with a thread pool into a global cache keyed byz/x/y; retry with backoff; never re-download a cached tile. Mosaic the chunk with rasterio (mergeor manual paste) into a temporary GeoTIFF; flush after the chunk. - Patch scan. Slide
PATCH_SIZEwithSTRIDE = PATCH_SIZE − OVERLAPin blocks ofPROCESS_BLOCKwith a halo ofOVERLAP. Normalise with the training mean/std. Batch to GPU (GPU_BATCH), AMP on. - Blend. Multiply each patch probability by a 2-D Hanning window and accumulate into
sumandweightarrays; divide at the end. This removes seam artefacts. - Threshold. Hysteresis: strong =
p ≥ THRESHOLD, weak =p ≥ HYST_LOW; keep weak pixels connected to strong ones (skimage.filters.apply_hysteresis_threshold). Writeprediction_binary.tif(uint8, LZW, tiled) per chunk. - Merge chunks.
rasterio.mergewithmethod='max'intomerged_prediction_binary.tifas a COG. Then hand off tozd-vector:raster-to-polygons/topology-repair.
Checks: tile coverage 100 % (count expected vs cached), no all-zero chunks unless outside AOI, prediction extent equals AOI bounds ± one tile. Weights: hf_hub_download(repo_id=os.environ["ZD_BOUNDARY_MODEL_REPO"], filename="best.pth", token=os.environ.get("HF_TOKEN")); cache locally under models/.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/zd-models/skills/boundary-inference/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/adilmunawar/zd-claude-plugin/boundary-inference)