技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
medsegdiff【数据与研究】Guide MedSegDiff medical-image segmentation workflows for dataset preparation, diffusion-model training, checkpoint sampling, ensemble aggregation, and evaluation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
MedSegDiff is a repository-level PyTorch diffusion framework for medical-image
segmentation. Use this skill when a task mentions MedSegDiff, its ISIC or BRATS
examples, diffusion-based segmentation, the guided_diffusion modules, or the
repository's segmentation train/sample/evaluation workflows.
sub-skills/data-preparation/SKILL.md.
It covers ISIC CSV/image/mask trees, BRATS NIfTI modalities and slices, and
custom 2D/3D layouts.sub-skills/training/SKILL.md. It covers the
training CLI contract, model/diffusion factories, schedules, checkpoints,
mixed precision, and multi-GPU behavior.sub-skills/inference-evaluation/SKILL.md.
It covers checkpoint compatibility, DDIM/DPM-Solver options, ensembles,
STAPLE aggregation, output naming, IoU/Dice, and per-class metrics.For a task spanning multiple routes, prepare and validate the data first, then
train or provide a compatible checkpoint, then sample and evaluate. Preserve
the dataset branch, effective input channels, image size, model version,
diffusion schedule, and checkpoint settings across every stage.
The upstream repository has no pyproject.toml, setup.py, console entry
point, or formal package metadata. Its documented dependency source is
requirement.txt. In a fresh isolated environment, install the public runtime
dependencies and make the checkout importable before using its Python modules:
python -m pip install -r requirement.txt
PYTHONDONTWRITEBYTECODE=1 python -c "import guided_diffusion.script_util as s; print(s.model_and_diffusion_defaults())"
Use a CUDA-enabled PyTorch build for actual training or sampling. CPU checks are appropriate for data loaders, metric helpers, and small factory/API smokes, but CPU is not a truthful substitute for the full training/sampling path: the runtime uses CUDA device placement and, during sampling, CUDA timing events and synchronization.
Before a real run, use the bundled safe inspectors and environment reference:
scripts/check_environment.py checks Python,
imports, and optional CUDA availability without downloading data or starting
training.references/api-reference.md records the
verified module and factory contracts.references/troubleshooting.md handles
cross-cutting install, import, backend, checkpoint, and path failures.references/repo-provenance.md tells you
when the source baseline is stale and a refresh is warranted.Keep medical data, checkpoints, predictions, and generated results outside the skill directory. Do not assume the repository's example data is complete; use the data-preparation validator and fetch data only through an approved, user-controlled source.
image_size is 64, while the documented example
recipes commonly use 256; only 64, 128, 256, and 512 have automatic channel
multipliers in the inspected source.True or False, not a bare
store_true switch.data_name=ISIC and data_name=BRATS select dedicated branches; other values
select the custom branch, whose 2D/3D detection has source-specific behavior.batch_size=1 for the unpatched sampler because several output-ID paths
use the first item of a batch.version, effective input channels, architecture flags, diffusion
steps/schedule, and checkpoint state as one compatibility tuple.This skill is guidance for operating the public repository; it does not claim medical validity, reproduce paper metrics without the required data/checkpoint, or replace clinical review.