AGENT SKILL

mmocr

Use MMOCR for OCR inference, dataset preparation, config-driven training/evaluation, model components, registries, and OpenMMLab OCR troubleshooting.

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

01 前言 Front Matter

name
mmocr
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use MMOCR for OCR inference, dataset preparation, config-driven training/evaluation, model components, registries, and OpenMMLab OCR troubleshooting.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

MMOCR

Use this repo skill when a task involves OpenMMLab MMOCR: text detection, text recognition, OCR chains, text spotting, key information extraction (KIE), OCR datasets, config-driven training/evaluation, or MMOCR component extension.

Start here

  1. Read references/package-overview.md for the package capability map, public install shape, backend expectations, and bundled helper summary.
  2. Run scripts/check_mmocr_environment.py when you need to verify imports, dependency versions, CUDA visibility, or optional config loading.
  3. Use the route map below for workflow details.
  4. Read references/troubleshooting.md for cross-cutting install/import/backend/download/headless-display failures.
  5. Check references/repo-provenance.md before deciding whether this skill matches a newer checkout or package version.

Minimal public install and import check

MMOCR depends on PyTorch, MMEngine, MMCV, and MMDetection. The project recommends OpenMIM for OpenMMLab packages:

pip install -U openmim
mim install mmengine
mim install mmcv
mim install mmdet
mim install mmocr

Then verify the environment from any working directory:

python scripts/check_mmocr_environment.py

For config work, verify that the config loads and uses the MMOCR registry scope:

python scripts/check_mmocr_environment.py --config CONFIG --require-default-scope mmocr

A CPU import/config check is not proof of CUDA, distributed, or Slurm readiness. Require real backend checks before claiming those paths work.

Route map

User asks for... Read
OCR inference over images/folders/arrays, MMOCRInferencer, task inferencers, saved predictions/visualizations, model aliases, KIE chains, or headless inference troubleshooting sub-skills/ocr-inference/SKILL.md
Config inspection, model-family selection, training/testing/evaluation command construction, work directories, checkpoints, AMP, TTA, distributed launch, or Slurm routing sub-skills/training-evaluation-configs/SKILL.md
Dataset preparation, dataset_zoo-style metadata, textdet/textrecog/textspotting/KIE annotation formats, LMDB recognition data, or dataset-layout debugging sub-skills/data-preparation/SKILL.md
Registries, DataSamples, transforms, model components, dictionaries, metrics, visualizers, custom modules, or OpenMMLab project extensions sub-skills/model-api-components/SKILL.md

Common decisions

  • For image prediction, use ocr-inference; for dataset evaluation against a checkpoint, use training-evaluation-configs.
  • For any train/test command, run the config smoke script first and confirm data/checkpoint availability before launching expensive work.
  • For private datasets, start with data-preparation and validate the annotation/task choice before editing training configs.
  • For registry or custom module errors, use model-api-components before trying another long run.
  • For remote servers, prefer saved visualization files over GUI display.
  • For pretrained aliases or dataset preparers, ask before using network downloads or shared caches.

Backend policy

  • CPU is enough for import checks, config smoke, dataset metadata preflight, registry probes, and many troubleshooting tasks.
  • CUDA/GPU is optional but required for honest accelerated inference/training/evaluation verification.
  • Distributed/NCCL and Slurm are optional operational backends; do not infer them from CPU success.
  • Long training, large evaluation, model downloads, dataset downloads, and scheduler jobs need explicit user approval.

Bundled helpers

Non-goals

  • This skill does not replace MMOCR's package installation or model weights.
  • It does not bundle full training/evaluation launchers, pretrained checkpoints, datasets, or GUI assets.
  • It does not claim CUDA, distributed, or Slurm readiness unless the caller verifies those backends in their runtime.

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