界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

customization-extension

customization-extension

【数据与研究】Extend MMDetection 3.3.0 with custom registries, models, losses, datasets, transforms, hooks, optimizers, project plugins, structures, and 2.x-to-3.x migration fixes.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: customization-extension description: "Extend MMDetection 3.3.0 with custom registries, models, losses, datasets, transforms, hooks, optimizers, project plugins, structures, and 2.x-to-3.x migration fixes." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Customization Extension

Use this sub-skill when an agent must add, register, debug, or migrate custom MMDetection components. It covers MMEngine registry usage, custom_imports, project plugin layout, custom model/data/runtime classes, and DetDataSample/box/mask structure expectations.

Route First

  • For config inheritance, model zoo selection, _base_, or cfg-options, use ../configuration-model-zoo/SKILL.md.
  • For dataset file layout, COCO conversion, annotation schemas, or metrics, use ../datasets-evaluation/SKILL.md.
  • For train/test launch commands, resume, distributed jobs, or result dumping, use ../training-testing/SKILL.md.
  • For inference API calls or visualization outputs, use ../inference-visualization/SKILL.md.

Core References

  • references/registries-and-apis.md: registry nodes, decorators, import/scope rules, structures, and migration API changes.
  • references/extension-workflows.md: workflows for custom models, losses, datasets, transforms, hooks, optimizers, projects plugins, and structures.
  • references/troubleshooting.md: diagnosis tables for registration, imports, default scope, class counts, data samples, transforms, optimizers, and 2.x migration failures.
  • scripts/registry_probe.py: inspect MMDetection registry contents and verify import paths without training.

Fast Workflow

  1. Identify the component boundary: model/loss/head/backbone uses MODELS; dataset uses DATASETS; transform uses TRANSFORMS; hooks use HOOKS; optimizers and constructors use optimizer registries.
  2. Register the Python class with the correct decorator from mmdet.registry, then ensure its module is imported by package __init__.py or by config-level custom_imports.
  3. Set default_scope='mmdet' or initialize the mmdet scope before registry builds when running standalone checks.
  4. Validate the component in isolation with scripts/registry_probe.py and a minimal Registry.build() or transform call before launching training.
  5. When modifying data flow, confirm pipeline keys before and after each transform and ensure final packed samples expose the fields consumed by the model.

Hard Usability Cases

  • A new bbox head appears in config as type='MyBBoxHead' but build fails with KeyError; debug registry node, import side effects, and default scope before editing model logic.
  • A custom transform returns missing or renamed keys; trace expected input/output keys through the pipeline and confirm packed DetDataSample fields before training.
我的收藏