/zd-ml:seg-preflightfrom Zaraat Dost · ML
Ten-point checklist that catches common segmentation-pipeline bugs including checkpoint keys, dataset reference sharing, split leakage, nodata handling, and class balance. Apply before training or when predictions are garbage.
Ships in Zaraat Dost · ML. 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.
| # | Check | How |
|---|---|---|
| 1 | Checkpoint format | torch.load(..., map_location='cpu') → is it a dict with model_state_dict or a bare state_dict? Strip module. prefixes from DataParallel; match smp/timm key names; print missing/unexpected keys with strict=False and fail if > 0 unexpected |
| 2 | Dataset object sharing | Assert id(train_ds.transform) != id(val_ds.transform) and that split lists are copies (list(...) / copy.deepcopy) — shared references leak train augmentation into val |
| 3 | Split leakage | Split by parcel/tile ID; assert not set(train_ids) & set(val_ids); check spatial overlap of tile bounds across splits with a GeoDataFrame sjoin |
| 4 | Label alignment | Image and mask share CRS, transform, shape; nodata pixels masked out of the loss (ignore_index) |
| 5 | Class balance | Print pixel share per class; use weighted CE / Dice+CE / focal when minority class < 5 % |
| 6 | Normalisation | Per-band mean/std computed on train only; Sentinel-2 reflectance scaled 0–1 (÷10000); SAR dB clipped (-25..0) |
| 7 | Patch extraction | Stride < patch size for training only; inference uses overlap + centre-crop blending |
| 8 | Reproducibility | Seed torch/numpy/random; cudnn.deterministic for eval; log git SHA and config |
| 9 | Resume path | Kill the run after 1 epoch, resume, assert epoch counter and LR continue |
| 10 | Eval metric | Per-class IoU/F1 on the full val set at native resolution, not on patches |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub adilmunawar/zd-claude-plugin --plugin zd-ml4 skills in this plugin
/colab-ram-safePatterns for RAM-limited notebooks: windowed reads, patch shards, progress files, Drive checkpoints./model-cardWrite an HF-compatible model card (data, classes, metrics, limits) next to a checkpoint./train-templateStructure for a PyTorch segmentation training script: resume, early stopping, cosine LR, AMP, full-state checkpoints, tiled inference.Other plugins' skills for the same job