mmaction2
Use MMAction2 for video understanding inference, datasets/configs, training/evaluation, models, registries, and deployment planning.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mmaction2
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use MMAction2 for video understanding inference, datasets/configs, training/evaluation, models, registries, and deployment planning.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/environment-and-installation.md5.0 KB
- 参考文档references/repo-provenance.md2.7 KB
- 参考文档references/repo-routing-metadata.json324 B
- 参考文档references/troubleshooting.md5.1 KB
- 脚本scripts/check_mmaction2_environment.py6.5 KB
03 SKILL.md 正文
MMAction2 repo skill
Use this skill when a task involves MMAction2, the OpenMMLab video-understanding toolbox for action recognition, skeleton/audio/video-text workflows, temporal localization, spatio-temporal action detection, model zoo configs, training/testing, evaluation, or registry-backed customization.
Start with the right sub-skill
sub-skills/inference-and-demos/SKILL.md— recognizer inference,init_recognizer,inference_recognizer,ActionRecogInferencer,MMAction2Inferencer, label maps, prediction dumps, visualization, and optional detector/pose-assisted demos.sub-skills/data-and-configs/SKILL.md— dataset annotation formats,VideoDataset/RawframeDataset/PoseDataset/AVADataset/ActivityNetDataset, transform pipelines, config inheritance, naming, and--cfg-optionsoverrides.sub-skills/training-and-evaluation/SKILL.md— training, testing, work directories, checkpoints, resume, AMP, CPU/GPU/distributed/Slurm command planning, metrics, dumps, and offline result analysis.sub-skills/models-and-extension/SKILL.md— model families, model-index categories, MMAction2 registries, custom modules/datasets/pipelines, project-style extensions, export, publishing, and deployment caveats.
Install and import baseline
Read references/environment-and-installation.md before diagnosing setup problems. The public baseline is:
pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0rc4,<2.2.0"
pip install mmaction2
For source-based development or access to the full tool/config tree, install the user's chosen MMAction2 checkout in editable mode after installing compatible PyTorch, MMEngine, and MMCV. CPU mode is supported for many smoke checks and small workflows; CUDA is optional unless the user asks for GPU-scale training/inference or a backend-specific native case.
Minimal import check:
import mmaction, mmcv, mmengine, torch
print(mmaction.__version__, mmcv.__version__, mmengine.__version__, torch.__version__)
Run scripts/check_mmaction2_environment.py when the task starts with installation, optional dependencies, CUDA availability, or config parse uncertainty.
Operating rules
- Prefer config/API inspection and command previews before launching expensive video workloads, training, distributed jobs, checkpoint conversion, or dataset-scale preprocessing.
- Pass
device="cpu"explicitly on CPU-only hosts; several MMAction2 APIs default to CUDA-like devices. - Treat model aliases, remote checkpoints, dataset downloads, and pretrained-weight URLs as network actions. Ask before relying on them when the user did not already authorize network/download work.
- Keep data/config issues separate from train/test failures: first validate annotation schema,
data_prefix, pipeline decode type, class count, and config inheritance, then plan a training/test run. - For optional workflows, name the missing extra precisely:
mmdet/mmposefor detector/pose-assisted demos,openai-clip/multimodal packages for some multimodal surfaces, ONNX/TorchServe packages for export/deployment helpers. - Do not claim that GPU, Slurm, deployment, or optional dependency flows are verified unless they were actually run in the user's current environment.
Common task routing
| User task | Read |
|---|---|
| "Run recognition on a video" / "use MMAction2Inferencer" | inference-and-demos |
"What does pred_score contain?" / "map top-k labels" |
inference-and-demos API reference |
| "Prepare custom videos/rawframes/skeleton/AVA data" | data-and-configs |
"Fix --cfg-options or config inheritance" |
data-and-configs |
| "Preview a CPU/GPU train/test command" | training-and-evaluation command builder |
| "Resume training or dump test predictions" | training-and-evaluation |
| "Which model family/config should I use?" | models-and-extension, then data-and-configs if config editing is needed |
| "Register a custom backbone/head/dataset/transform" | models-and-extension |
| "Export/publish/convert a checkpoint" | models-and-extension export/deployment reference |
| "Is this generated skill current for my checkout?" | references/repo-provenance.md |
Shared references and helpers
references/environment-and-installation.md— public installation modes, dependency variants, optional extras, and safe environment checks.references/troubleshooting.md— cross-cutting import, dependency, backend, data/config, checkpoint, and optional-extra failures.references/repo-provenance.md— source snapshot used to generate this skill; read it before deciding whether to refresh the skill.references/repo-routing-metadata.json— structured scenario metadata for managed repo-skill routing.scripts/check_mmaction2_environment.py— safe import/version/backend/config probe.
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).