model-api-components
Use and extend MMOCR registries, model components, data samples, transforms, metrics, visualizers, dictionaries, and OpenMMLab project extensions.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-api-components
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use and extend MMOCR registries, model components, data samples, transforms, metrics, visualizers, dictionaries, and OpenMMLab project extensions.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/component-api-reference.md16.4 KB
- 参考文档references/extension-patterns.md11.6 KB
- 参考文档references/troubleshooting.md12.7 KB
- 脚本scripts/mmocr_component_registry_probe.py9.3 KB
03 SKILL.md 正文
MMOCR model API components
Use this sub-skill when the task is to inspect, build, register, customize, or troubleshoot MMOCR internals rather than to run an end-to-end OCR prediction or a full training job.
Best-fit tasks
- Register or build MMOCR model, transform, metric, visualizer, dictionary, or project-extension components through OpenMMLab registries.
- Decide which
DataSamplefields a custom head, postprocessor, metric, or visualizer should read and write. - Add a custom backbone, head, postprocessor, metric, transform, or visualizer through a project module without editing the core MMOCR package.
- Diagnose registry/default-scope issues, dictionary token mismatches, transform pipeline type lookup failures, visualization/font/headless problems, and metric output-shape surprises.
Route these instead:
- End-to-end OCR/KIE inference, pretrained inferencers, or prediction result schemas:
../ocr-inference/. - Train/test CLIs, config inheritance, work directories, checkpoints, and evaluator placement in full experiments:
../training-evaluation-configs/. - Dataset conversion/preparation CLIs and dataset-zoo acquisition:
../data-preparation/.
Read this sub-skill
- Start with component-api-reference for registry names, data structures, model families, dictionaries, transforms, metrics, visualizers, and utility entry points.
- Use extension-patterns when adding custom modules through OpenMMLab project-style registration.
- Use troubleshooting when a component cannot be built, registered, visualized, evaluated, or connected to the expected
DataSamplefields. - Use the bundled
mmocr_component_registry_probe.pyto inspect registry availability and dictionary files in the active Python environment.
Operating rules
- Prefer registry/config-based extension over direct edits to MMOCR core modules.
- Initialize or preserve the
mmocrdefault scope before building components from config dicts. - Import custom extension modules before building configs that name their registered classes.
- Treat
TextDetDataSample,TextSpottingDataSample,TextRecogDataSample, andKIEDataSampleas the contract between models, postprocessors, metrics, and visualizers. - Keep dictionary files, token settings, postprocessor ignore characters, and recognition label fields synchronized.
- For component-level debugging, verify imports, registry membership, sample field presence, and small synthetic inputs before using full datasets or checkpoints.
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).