协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
segmentation-models-pytorch【开发与工程】Route segmentation_models_pytorch tasks for semantic segmentation model creation, encoders, preprocessing, losses, metrics, export, and repository maintenance.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when the task involves segmentation_models_pytorch (SMP), a PyTorch semantic segmentation library with high-level model constructors, pretrained encoders, segmentation losses/metrics, and save/load/export workflows.
Unet, FPN, DeepLabV3Plus, Segformer, DPT, smp.create_model, tensor shapes, auxiliary heads, or encoder freeze/unfreeze behavior.encoder_name, list supported encoders, migrate deprecated timm- names, use tu- timm universal encoders, configure pretrained weights, or get preprocessing mean/std functions.DiceLoss, JaccardLoss, TverskyLoss, FocalLoss, binary/multiclass/multilabel target shapes, smp.metrics.get_stats, IoU/F1/accuracy, or safe training/evaluation loops.save_pretrained, smp.from_pretrained, changed class counts with strict=False, Hugging Face Hub sharing, ONNX, TorchScript, torch.export, or torch.compile readiness.SMP is published as segmentation-models-pytorch on PyPI and imports as segmentation_models_pytorch:
pip install -U segmentation-models-pytorch
python - <<'PY'
import segmentation_models_pytorch as smp
print(smp.__version__)
print(sorted(smp.MODEL_ARCHITECTURES_MAPPING))
PY
For local repo work, install the current checkout in editable mode with its runtime dependencies. Add test or docs extras only when the task actually needs tests or documentation builds.
smp.Unet, smp.UnetPlusPlus, smp.MAnet, smp.Linknet, smp.FPN, smp.PSPNet, smp.PAN, smp.DeepLabV3, smp.DeepLabV3Plus, smp.UPerNet, smp.Segformer, smp.DPT.smp.create_model(arch, encoder_name="resnet34", encoder_weights="imagenet", in_channels=3, classes=1, **kwargs).smp.encoders.get_encoder_names(), get_encoder(...), get_preprocessing_params(...), and get_preprocessing_fn(...).smp.losses.BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE, plus Dice, Jaccard, Tversky, Focal, Lovasz, SoftBCE, SoftCE, and MCC losses.smp.metrics.get_stats(...) followed by iou_score, f1_score, accuracy, precision, recall, or related rates.model.save_pretrained(...) and smp.from_pretrained(...) for local directories or Hub repos when network and credentials are available.encoder_weights=None for offline smoke tests to avoid downloading pretrained weights.64x64 or 128x128 for shape checks; do not run notebook-scale training or dataset downloads unless the user explicitly requests them.classes=1 for binary logits, classes=N for multiclass/multilabel logits, and choose the matching loss/metric mode in training-evaluation.Refresh this skill when SMP changes model constructors, architecture registry names, encoder registry behavior, pretrained weight handling, loss/metric signatures, save/load APIs, export compatibility, package dependencies, or maintainer test conventions. Use Repository Provenance to compare the current checkout against the generation baseline.