AGENT SKILL

mmsegmentation

Use MMSegmentation for semantic segmentation configs, datasets, inference, training, evaluation, model customization, registries, and troubleshooting.

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

01 前言 Front Matter

name
mmsegmentation
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use MMSegmentation for semantic segmentation configs, datasets, inference, training, evaluation, model customization, registries, and troubleshooting.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

MMSegmentation

Use this repo skill when a task involves OpenMMLab MMSegmentation: semantic segmentation or depth configs, model zoo recipes, datasets and transforms, inference, training/testing, metrics, custom models, registries, checkpoints, or OpenMMLab dependency errors.

Start Here

  1. Confirm the installed package imports:

    python -c "import mmseg, mmcv, mmengine; print(mmseg.__version__, mmcv.__version__, mmengine.__version__)"
    
  2. Read install-and-compatibility if the task touches setup, dependency pins, CPU/CUDA, mmcv, torch, numpy, OpenCV, or optional project dependencies.

  3. Run check_mmseg_env.py for a deterministic import/version/backend check before blaming user code.

  4. Route to the focused sub-skill below.

Route By Task

  • Inference and visualization: read inference for MMSegInferencer, init_model, image/video/batch inference, SegDataSample, headless output, saved masks, remote-sensing tiled inference, and deployment caveats.
  • Configs, datasets, and transforms: read data-configuration for MMEngine config inheritance, --cfg-options, packaged config families, dataset layouts, BaseSegDataset, transforms, class palettes, and dataset-conversion patterns.
  • Training, testing, and metrics: read training-evaluation for safe train/test command construction, Runner.from_cfg, resume vs fine-tune, IoUMetric, DepthMetric, TTA, output formatting, distributed launch, Slurm, and log analysis.
  • Models, registries, and checkpoints: read model-customization for built-in components, custom backbones/heads/losses/metrics, MODELS/METRICS, custom_imports, project extensions, checkpoint conversion, FLOPs caveats, and registry debugging.

Common Decisions

  • Prefer adapting an existing model-zoo config over writing a full model dict from scratch.
  • Prefer local config and checkpoint files for deterministic inference; model aliases can trigger checkpoint downloads.
  • Treat training, testing, benchmarks, dataset conversion, checkpoint conversion, and distributed jobs as side-effectful; use bundled dry-run wrappers first and execute only after approval.
  • Keep default_scope = 'mmseg' unless intentionally composing with another OpenMMLab package.
  • Use CPU for inspection and small smoke checks; document CUDA/NPU/other backends as runtime choices that need matching torch/mmcv builds.

Shared References

Bundled Helpers

  • scripts/check_mmseg_env.py: imports core modules, checks versions, optional CUDA visibility, and warns about common incompatible numpy/OpenCV/torch/MMCV combinations.
  • Sub-skill helpers provide safe inference, config inspection, dataset layout checking, dry-run train/test commands, log analysis, and registry inspection.

Do Not

  • Do not tell future agents to run original checkout scripts or open original docs as part of this skill. Use the bundled references and scripts here.
  • Do not launch long training, distributed jobs, benchmarks, downloads, or dataset conversion without user approval.
  • Do not assume mmcv-lite can run all model/API paths; model components that use compiled ops may require full mmcv matched to torch and the backend.
  • Do not treat random-weight inference or a no-checkpoint model build as meaningful segmentation output.

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