inference-and-api
Use YOLOX for PyTorch inference, demo CLI/API setup, model selection, checkpoint loading, preprocessing/postprocessing, visualization, and quick diagnostics.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference-and-api
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use YOLOX for PyTorch inference, demo CLI/API setup, model selection, checkpoint loading, preprocessing/postprocessing, visualization, and quick diagnostics.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/inference-workflows.md4.1 KB
- 参考文档references/model-and-api-reference.md2.4 KB
- 参考文档references/troubleshooting.md2.4 KB
- 脚本scripts/yolox_inference_smoke.py4.5 KB
03 SKILL.md 正文
YOLOX Inference And API
Use this sub-skill when the task is to run YOLOX image, video, or webcam inference, choose a built-in model or custom experiment, load a checkpoint, reproduce the package demo flow in Python, inspect inference-time APIs, or perform a lightweight install/model smoke check.
Route training, evaluation, custom datasets, caching, and experiment logging to ../training-and-data/SKILL.md. Route ONNX, TorchScript, TensorRT, OpenVINO, ncnn, and other deployment backend work to ../export-and-deployment/SKILL.md.
Read/run map
- Read references/inference-workflows.md for package-style demo commands, checkpoint loading expectations, and a distilled Python inference recipe.
- Read references/model-and-api-reference.md for built-in model names, default experiment facts, key signatures, output conventions, and source-script treatment.
- Read references/troubleshooting.md for checkpoint, image/video, device, FP16, legacy-weight, OpenCV, and TensorRT-route failures.
- Run scripts/yolox_inference_smoke.py to validate imports, experiment resolution, model construction, optional CUDA allocation, and optional dummy forward without weights or downloads.
Fast decisions
- For standard COCO architectures, prefer
--namewithyolox-s,yolox-m,yolox-l,yolox-x,yolox-tiny,yolox-nano, oryolov3. - For a custom class count, custom size, or modified architecture, prefer
--exp-fileand a checkpoint trained from that sameExp. - For visual demos, use installed module commands such as
python -m yolox.tools.demo ...rather than checkout script paths. - For library use, reproduce the core flow:
get_exp,exp.get_model(), loadckpt["model"]or a state dict,model.eval(), optional CUDA/half/fuse,ValTransform, forward,postprocess, andvis. - For deployment-specific
--trtor exported graphs, stop after identifying the route and hand off to export/deployment.
Minimal safe diagnostic
From this sub-skill directory:
python scripts/yolox_inference_smoke.py --name yolox-nano --device cpu --test-size 64
Add --dummy-forward only when you want to exercise a real forward pass without weights. Use a small --test-size for CPU-only diagnostics.
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).