/zd-models:boundary-inferencefrom Zaraat Dost · Models
Runs chunked low-RAM boundary model inference over an area of interest from XYZ tiles: tile caching, patch scanning with Hanning blending, hysteresis thresholding, and merged COG output.
Ships in Zaraat Dost · Models. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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
CHUNK_SIZE_M squares. One output folder per chunk; skip chunks whose prediction.tif already exists (resume).mercantile.tiles(bbox, ZOOM); download in batches (DOWNLOAD_BATCH_SIZE) with a thread pool into a global cache keyed by z/x/y; retry with backoff; never re-download a cached tile. Mosaic the chunk with rasterio (merge or manual paste) into a temporary GeoTIFF; flush after the chunk.PATCH_SIZE with STRIDE = PATCH_SIZE − OVERLAP in blocks of PROCESS_BLOCK with a halo of OVERLAP. Normalise with the training mean/std. Batch to GPU (GPU_BATCH), AMP on.sum and weight arrays; divide at the end. This removes seam artefacts.p ≥ THRESHOLD, weak = p ≥ HYST_LOW; keep weak pixels connected to strong ones (skimage.filters.apply_hysteresis_threshold). Write prediction_binary.tif (uint8, LZW, tiled) per chunk.rasterio.merge with method='max' into merged_prediction_binary.tif as a COG. Then hand off to zd-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/.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
boundary-inference, geospatial, raster-processing, tile-cache, cog
npx claudepluginhub adilmunawar/zd-claude-plugin --plugin zd-models6 skills in this plugin
/landuse-classifyTrain or run the XGBoost land-use classifier: classes, T-minus alignment, model bundle, unified parcel/sub-parcel inference, predictions.gpkg./sam2-boundariesZero-shot field boundaries with SAM2: tiled inference, seam stitching, cleanup, GeoJSON, alignment./script-to-packageTurn a constants-at-top pipeline script into a configured, resumable, tested CLI./spectral-featuresPer-parcel Sentinel-1/2 feature matrix from Earth Engine: 15-day composites, band and index set, chunked reduceRegions, batch parquet, resume.Other plugins' skills for the same job