AGENT SKILL

inference

Run DAMO-YOLO image, video, and camera inference with Torch, ONNX, or TensorRT engines.

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

01 前言 Front Matter

name
inference
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Run DAMO-YOLO image, video, and camera inference with Torch, ONNX, or TensorRT engines.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

inference

Use this sub-skill when the task is to run or troubleshoot DAMO-YOLO demo inference on images, videos, or a live camera, or when the user needs to choose between Torch, ONNX, and TensorRT runtime engines.

Route here for

  • Image, video, and camera demo workflows with a DAMO-YOLO config and an engine artifact.
  • Choosing .pth/.pt, .onnx, or .trt inference and explaining required optional runtimes.
  • Setting --device, --infer_size, --conf, --end2end, output/visualization behavior, and class labels.
  • Debugging missing OpenCV, Pillow, torchvision, ONNX Runtime, TensorRT/CUDA Python, invalid input media, or class-name mismatch failures.

Route elsewhere

  • Training, finetuning, optimizers, distributed launch, and checkpoint production: use the training sub-skill.
  • COCO evaluation loops, metric reproduction, and multi-GPU dataset inference: use evaluation/training integration guidance rather than this demo route.
  • ONNX/TensorRT export implementation, converter internals, TensorRT evaluation, and partial quantization: use the deployment sub-skill.

Start here

  1. Read engine-and-data-flow.md to choose the runtime engine and understand preprocessing, postprocessing, visualization, class names, and device behavior.
  2. Read demo-workflows.md for concrete image/video/camera commands using the bundled safe helper at scripts/damo_yolo_safe_demo.py.
  3. If you need to understand why a source file was bundled, adapted, or kept reference-only, read source-decisions.md.
  4. If anything fails, use troubleshooting.md before changing configs or reinstalling dependencies.

Fast command templates

Replace the config, engine, and media paths with user-owned files. Use the resolved path to the bundled scripts/damo_yolo_safe_demo.py helper. Keep the config matched to the engine checkpoint/export; if the config reads relative TinyNAS structure files, run from the directory that contains those config-relative assets or make paths absolute in the config.

# Torch checkpoint on an image; falls back to CPU if CUDA is unavailable.
python sub-skills/inference/scripts/damo_yolo_safe_demo.py image \
  -f /path/to/damoyolo_config.py \
  --engine /path/to/damoyolo_checkpoint.pth \
  --path /path/to/example.jpg \
  --infer-size 640 640 --device cuda --conf 0.6 --output-dir demo

# ONNX engine on a video; requires onnxruntime.
python sub-skills/inference/scripts/damo_yolo_safe_demo.py video \
  -f /path/to/damoyolo_config.py \
  --engine /path/to/damoyolo.onnx \
  --path /path/to/input.mp4 \
  --infer-size 640 640 --device cuda --conf 0.6 --output-dir demo

# TensorRT engine from a camera; requires TensorRT + CUDA Python and usually CUDA.
python sub-skills/inference/scripts/damo_yolo_safe_demo.py camera \
  -f /path/to/damoyolo_config.py \
  --engine /path/to/damoyolo_end2end_fp16_bs1.trt \
  --camid 0 --infer-size 640 640 --device cuda --conf 0.6 --end2end --output-dir demo

Option meanings to preserve

  • --conf is the visualization/display threshold. NMS thresholds come from the config (model.head.nms_conf_thre, model.head.nms_iou_thre).
  • --infer_size H W is the resize/pad target used by Torch and TensorRT engines. ONNX engines may derive the target from the ONNX input shape.
  • --end2end is only for TensorRT engines exported with NMS included; using it on the wrong .trt layout changes the expected output tensors.
  • Source-style --save_result saves visualizations by default. The bundled helper also supports --no-save-result and only opens GUI windows when --show-window is explicit.

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