inference-and-demos
Use MMAction2 inference APIs, inferencers, labels, visualization outputs, and optional pose/detection demo flows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference-and-demos
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use MMAction2 inference APIs, inferencers, labels, visualization outputs, and optional pose/detection demo flows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md9.3 KB
- 参考文档references/demo-workflows.md9.9 KB
- 参考文档references/troubleshooting.md10.5 KB
- 脚本scripts/mmaction2_inference_smoke.py7.9 KB
03 SKILL.md 正文
MMAction2 inference and demos
Use this sub-skill when the user needs MMAction2 action-recognition inference, high-level inferencer usage, label mapping, prediction dumps, headless visualization, or the optional human-detection/pose paths used by skeleton and spatio-temporal detection workflows.
Route here for
- Direct recognizer inference with
init_recognizerandinference_recognizer, including access toActionDataSample.pred_score. - High-level
ActionRecogInferencerorMMAction2Inferencerworkflows using local configs/checkpoints, model aliases, label files,pred_out_file, andvid_out_dir. - Video-file, rawframe-folder, decoded-array, audio-feature
.npy, and already-packed pose/dict inputs when the selected API supports that input form. - CPU/GPU device choice, safe build-only checks, and troubleshooting of decode, visualization, optional dependency, and config/checkpoint mismatch failures.
- Optional skeleton recognition and spatio-temporal detection flows that depend on separately installed detector/pose packages and local checkpoints.
Route elsewhere
- Dataset annotation formats, data preparation, config authoring, and
--cfg-optionsdesign:../data-and-configs/SKILL.md. - Training, testing, evaluation metrics, distributed launch, and work directory management:
../training-and-evaluation/SKILL.md. - Model-family selection beyond inference, custom modules, registry extension, export, and deployment:
../models-and-extension/SKILL.md.
Choose the smallest safe entry point
- Build/config smoke only: run
scripts/mmaction2_inference_smoke.pywith--config CONFIG.py --check-build-only. It imports MMAction2, parses a local config, builds withcheckpoint=None, and never downloads weights. - Need raw scores or an
ActionDataSample: useinit_recognizer(..., device="cpu")plusinference_recognizer(...); readresult.pred_scoreand map class indices with a user-supplied label file. - Need packaged prediction/visualization output: use
ActionRecogInferencerfor action recognition, especially when selectinginput_format="video","rawframes", or"array". - Need a unified demo-like wrapper: use
MMAction2Inferencer(rec=..., rec_weights=..., device=..., label_file=...); use it one input at a time when saving visualizations. - Need skeleton or spatio-temporal detection: first confirm optional detector/pose dependencies and local detector/pose/action checkpoints; then follow the staged workflows in the references.
Safety defaults
- Prefer
device="cpu"unless the user explicitly asks for CUDA and the runtime proves CUDA is available. Several public APIs default to"cuda:0", so pass the device explicitly on CPU-only hosts. - Prefer local config and checkpoint paths. Model aliases or full model names can trigger metadata weight lookup; do not rely on remote downloads for smoke checks.
- Keep GUI display disabled on headless servers (
show=False); save visualizations withvid_out_diror requestreturn_vis=Truein code. - When dumping predictions, use a file extension supported by MMEngine serialization and keep
return_datasamples=Falseunless the consumer explicitly needsActionDataSampleobjects.
Local references
references/api-reference.md— verified signatures, defaults, input forms, result objects, devices, labels, and checkpoint/model selection.references/demo-workflows.md— concrete API snippets, demo-like command patterns, visualization, skeleton, and spatio-temporal detection workflows.references/troubleshooting.md— common inference failures and recovery steps, including optional dependency and video decode errors.scripts/mmaction2_inference_smoke.py— safe build/inference smoke helper with signature printing and no downloads by default.
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).