mmdetection
Use this skill when working with MMDetection 3.x for object detection, instance/panoptic segmentation, tracking-adjacent configs, model zoo configs, inference, visualization, training/testing commands, datasets, evaluation, or extension work.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mmdetection
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use this skill when working with MMDetection 3.x for object detection, instance/panoptic segmentation, tracking-adjacent configs, model zoo configs, inference, visualization, training/testing commands, datasets, evaluation, or extension work.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md2.4 KB
- 参考文档references/repo-routing-metadata.json507 B
- 参考文档references/troubleshooting.md3.8 KB
- 脚本scripts/check_mmdet_environment.py2.3 KB
03 SKILL.md 正文
MMDetection
MMDetection is OpenMMLab's PyTorch-based detection toolbox. Use this root skill as a router, then open the nearest sub-skill for concrete commands, APIs, config patterns, and troubleshooting.
Quick Import and Environment Check
Use the bundled checker when diagnosing an install before deeper work:
python scripts/check_mmdet_environment.py
A healthy base environment should import mmdet, mmcv, mmengine, and torch, report compatible MMDetection/MMCV/MMEngine versions, and expose inference APIs such as DetInferencer, init_detector, and inference_detector.
Important dependency facts:
- MMDetection 3.3.0 requires
mmcv>=2.0.0rc4,<2.2.0andmmengine>=0.7.1,<1.0.0. - Install full
mmcvfor workflows importingmmcv.ops;mmcv-litecan fail withModuleNotFoundError: mmcv._ext. - Match
torch,mmcv, CUDA/CPU wheels, NumPy, and OpenCV carefully; ABI mismatches often appear during API imports. - CPU inspection/inference is possible for many workflows, but some ops and real training/evaluation workloads are GPU- or dataset-dependent.
Read references/troubleshooting.md for cross-cutting install/import/backend failures. Read references/repo-provenance.md when deciding whether this skill is stale against a newer MMDetection checkout.
Route by Task
| User task | Open this sub-skill | Why |
|---|---|---|
Choose a config, inspect _base_, apply --cfg-options, compare model zoo entries, or debug config loading |
sub-skills/configuration-model-zoo/SKILL.md |
Owns config inheritance, model-index/metafile navigation, model names, override validation, and config migration pointers. |
Run image/folder/video-style inference, save prediction JSON or visualizations, use DetInferencer, init_detector, or inference_detector |
sub-skills/inference-visualization/SKILL.md |
Owns public inference APIs, output controls, device/palette choices, headless visualization, and deployment route selection. |
| Build training, resume, distributed, Slurm, testing, evaluation, or result-dump commands | sub-skills/training-testing/SKILL.md |
Owns tools/train.py, tools/test.py, distributed launcher patterns, --resume, --auto-scale-lr, work_dir, and command validation. |
| Prepare datasets, convert image folders/annotations, configure COCO/VOC/Cityscapes/LVIS/OpenImages metrics, or debug transforms/evaluators | sub-skills/datasets-evaluation/SKILL.md |
Owns dataset layouts, COCO-like schemas, custom dataset config, transforms, metrics, analysis tools, and tiny dataset helpers. |
| Add custom models, heads, losses, datasets, transforms, hooks, optimizer constructors, structures, or project plugins | sub-skills/customization-extension/SKILL.md |
Owns registries, custom_imports, project templates, MMEngine integration, data structures, and migration/customization pitfalls. |
Common Workflow Chains
Config to Inference
- Use
configuration-model-zooto select a compatible config and inspect inherited settings. - Use
inference-visualizationto chooseDetInferenceror lower-level APIs. - Use root
references/troubleshooting.mdif imports fail before model construction.
Custom Dataset Training
- Use
datasets-evaluationto validate annotation schema, class order,metainfo, and evaluator paths. - Use
configuration-model-zooto update config dataloaders, heads, and overrides. - Use
training-testingto generate training/resume/test commands. - Use
customization-extensiononly if a new dataset/transform class must be registered.
New Component or Project Plugin
- Use
customization-extensionfor registry ownership,custom_imports, module layout, and smoke checks. - Use
configuration-model-zooto wire the new type into configs. - Use
training-testingfor safe launch command generation.
Runtime Files
references/repo-provenance.md: source commit, version, dirty state, and evidence baseline.references/troubleshooting.md: cross-cutting install/import/backend and dependency failures.scripts/check_mmdet_environment.py: safe import/version/API signature checker.
Boundaries
This skill is self-contained guidance for future agents. It does not bundle MMDetection itself, pretrained checkpoints, datasets, videos, Docker images, or source-checkout-only tools. When a native MMDetection checkout is available, original demos/tests/tools can be used as optional verification candidates, but runtime instructions in this skill prefer bundled helpers or package APIs.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).