AGENT SKILL

medical-zoo-pytorch

Operate MedicalZooPytorch 3D medical image segmentation, data loading, losses, training, inference, and COVID 2D classification workflows.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
medical-zoo-pytorch
license
MIT
metadata
{ "disco-role": "operating" }
description
Operate MedicalZooPytorch 3D medical image segmentation, data loading, losses, training, inference, and COVID 2D classification workflows.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

MedicalZooPytorch

Use this repo skill when a task involves MedicalZooPytorch, its lib.* modules, 3D medical image segmentation in PyTorch, medical-image dataset loaders, segmentation losses, training/inference loops, or the repository's small 2D COVID classification branch.

First checks

  1. Confirm the MedicalZooPytorch code is available as importable Python modules. This repository exposes lib.* directly and may not provide package metadata, so a local checkout often needs its repository root on PYTHONPATH or another explicit import path.
  2. Install a PyTorch build appropriate for the user's CPU/CUDA environment, then install the non-torch runtime dependencies used by selected workflows: nibabel, scipy, matplotlib, Pillow, tensorboard, torchsummary, torchsummaryX, and torchvision for the COVID branch.
  3. Run the root smoke check before using deeper routes:
python scripts/smoke_repo_imports.py
python scripts/smoke_repo_imports.py --cuda

Use --package-root /path/to/MedicalZooPytorch if the modules are not already importable. Do not run full training or the original examples until dataset folders and checkpoint/output paths are confirmed.

Route by task

Shared references

Repository operating model

MedicalZooPytorch is source-tree-oriented rather than packaged like a modern PyPI project. Its public import surface is mostly:

  • lib.medzoo: model classes plus create_model(args).
  • lib.medloaders: dataset loader classes plus generate_datasets(args, path=...).
  • lib.losses3D: factory and concrete loss classes.
  • lib.train: trainer loops.
  • lib.visual3D_temp: TensorBoard writer and visualization helpers.
  • lib.utils: reproducibility, input preparation, checkpoint-era helpers, and COVID metrics.

The old example launchers are valuable evidence, but this skill distills them into bundled references and smoke scripts. Do not point a future user at source examples as required runtime documentation; use the sub-skill workflows instead.

Backend and data expectations

  • CPU is enough for import checks, loss checks, preprocessing checks, and tiny model forward passes.
  • CUDA is needed to truthfully exercise paths that move models/tensors with .cuda() or that mirror the historical GPU-oriented training/inference examples.
  • Real dataset loader runs require the actual ISEG/BraTS/MRBRAINS/IXI/MICCAI/COVID files in the documented folder structure; the repository includes mostly placeholder readmes and some COVID manifest text files, not the full image data.
  • Full training and inference are data-heavy and long-running. Use bundled smoke scripts first, then run full experiments only after data paths, output directories, model class, loss return contract, and device placement are confirmed.

Safe bundled scripts

  • scripts/smoke_repo_imports.py checks cross-cutting imports and optional CUDA availability.
  • Each sub-skill has smaller scripts for its owned workflow. Prefer those before running a complete training job.

Avoid this skill when

  • The task is about another medical-imaging framework such as MONAI, nnU-Net, or TorchIO and does not name MedicalZooPytorch or its APIs.
  • The user wants general medical-imaging theory rather than operating this package.
  • The task is repository maintenance or code editing rather than package usage; then use normal repo-development context and tests instead of this runtime operating graph.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351