AGENT SKILL

cpp-onnx-port

Operate the optional 3DDFA C++ OpenCV DNN port, checkpoint-to-ONNX export, weight placement, build/run expectations, and C++ troubleshooting.

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

01 前言 Front Matter

name
cpp-onnx-port
license
MIT
metadata
{ "disco-role": "operating" }
description
Operate the optional 3DDFA C++ OpenCV DNN port, checkpoint-to-ONNX export, weight placement, build/run expectations, and C++ troubleshooting.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

cpp-onnx-port

Use this sub-skill when the task is about the optional 3DDFA C++ demo, OpenCV DNN execution, MobileNet checkpoint export to ONNX, C++ weight placement, CMake/OpenCV build behavior, or C++ output failures.

Do not use this sub-skill as the primary guide for Python inference, rendering internals, training, or benchmark evaluation. Route those tasks to sibling skills when available:

  • Python image/video inference and checkpoint choice: ../python-inference/SKILL.md
  • Geometry, vertices, OBJ/PLY, PNCC, depth, and rendering internals: ../geometry-rendering/SKILL.md
  • Training recipes, losses, checkpoints, and benchmarks: ../training-evaluation/SKILL.md

Operating Map

  1. For C++ build and demo behavior, read references/cpp-build-and-runtime.md.
  2. For checkpoint export, read references/onnx-export.md and use scripts/export_mobilenet_to_onnx.py instead of relying on the original conversion helper.
  3. For missing faces, missing weights, OpenCV DNN, ONNX, CMake, or output-image failures, read references/troubleshooting.md.

Key Constraints

  • The C++ port is optional and unoptimized; it relies on OpenCV DNN and was documented for OpenCV 4.2.0 or newer.
  • The C++ demo uses CPU OpenCV DNN backends for both the YOLO face detector and MobileNet landmark predictor.
  • The source distribution includes C++ matrix/config text files, but the MobileNet ONNX file and YOLO binary weights are external artifacts that must be supplied by the operator.
  • The C++ demo is hard-coded around a single sample image and writes a landmark-overlay image under its result directory unless the C++ source is adapted.
  • Keep num_classes=62 for C++ landmark compatibility: 12 pose/projection values, 40 shape coefficients, and 10 expression coefficients.

Safe Actions

  • Build only after confirming OpenCV development headers/libraries are available and the required external model files are present.
  • Export ONNX from a known 3DDFA MobileNet checkpoint with the bundled helper and inspect remapped checkpoint keys before trusting the file.
  • Treat CMake, OpenCV, detector, predictor, and output-path problems as separate failure classes; do not debug them as one generic C++ failure.

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