supervision
Route Supervision computer-vision package workflows for detections, annotators, datasets, tracking, metrics, and media utilities.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- supervision
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route Supervision computer-vision package workflows for detections, annotators, datasets, tracking, metrics, and media utilities.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/overview.md5.6 KB
- 参考文档references/repo-provenance.md2.5 KB
- 参考文档references/repo-routing-metadata.json487 B
- 参考文档references/troubleshooting.md5.6 KB
- 脚本scripts/check_supervision_install.py6.9 KB
03 SKILL.md 正文
Supervision
Use this repo skill when a task uses the supervision Python package as a
computer-vision utility layer: normalized detections, visual annotation, dataset
conversion, tracking/keypoints, evaluation metrics, image/video helpers, zones,
sinks, slicers, and optional OpenCV backend behavior.
Install and minimal check
pip install supervision
python -c "import supervision as sv; print(sv.__version__)"
Add extras only for workflows that need them:
pip install "supervision[metrics]" # pandas-backed metric tables and evaluation
pip install "supervision[geotiff]" # rasterio/windowed GeoTIFF slicing
Native OpenCV is optional. Use Supervision's fallback backend by default; install exactly one OpenCV wheel only when the application needs native OpenCV behavior, GUI windows, webcam capture, or broader codec compatibility.
Run the bundled check_supervision_install.py helper when the environment is unknown.
Start here
- Read overview for the package map, core concepts, optional extras, and deprecation summary.
- Read troubleshooting for cross-cutting install/import/backend/deprecation failures.
- Read repo provenance before deciding whether this skill matches a different checkout or package version.
Route by task
| User intent or signals | Sub-skill |
|---|---|
Detections, model adapters, VLM parsing, compact masks, filtering, NMS/NMM, zones, tiled inference, smoothing, CSV/JSON sinks |
detection-and-zones |
Drawing boxes, masks, labels, traces, heatmaps, zones, comparison panels, and other high-level scene + detections/keypoints visualization |
annotators |
| YOLO/COCO/Pascal VOC/LabelMe/CreateML dataset loading/export, dataset splitting/merging, classification folder datasets | datasets |
KeyPoints, keypoint adapters/annotators, keypoint-to-detection conversion, tracker IDs, ByteTrack compatibility/migration, line crossing with identity |
tracking-keypoints |
mAP, mAR, precision, recall, F1, confusion matrices, MetricTarget, AveragingMethod, dataset-backed evaluation |
metrics |
| Image/video/file helpers, primitive drawing, colors, geometry, notebook display, assets, OpenCV fallback/native backend, GUI/windows, codecs | media-utils |
Operating principles
- Treat
sv.Detectionsas the shared object between model adapters, filters, zones, trackers, annotators, datasets, sinks, slicers, and metrics. - Keep aligned arrays aligned. Filter the container object, not individual
xyxy,confidence,class_id,mask,tracker_id, ordataarrays. - Import metadata keys from
supervision.configwhen writing reusable code:CLASS_NAME_DATA_FIELD,ORIENTED_BOX_COORDINATES, andAREA_DATA_FIELD. - Keep heavy optional model/framework imports lazy and model-specific. Supervision adapters convert already-produced results; they do not download models or install external frameworks.
- Use
scene.copy()before annotation when the original image or frame must be preserved. Annotators draw on the provided scene and return it. - Prefer current APIs:
supervision.key_points/sv.KeyPoints,keypoint_confidence,sv.VLM, andDetections.from_vlm. Treatsupervision.keypoint,KeyPoints.confidence,sv.ByteTrack,sv.LMM, andfrom_lmmas compatibility or migration topics. - Do not rely on original repository docs, examples, tests, notebooks, scripts, or local checkout files as runtime dependencies. The necessary operating guidance is distilled into this skill tree.
Common route combinations
- Annotate model output: use
detection-and-zonesto normalize raw results intoDetections, thenannotatorsto draw on images or video frames. - Evaluate a dataset: use
datasetsto load/convert annotations,detection-and-zonesto normalize predictions, andmetricsto compute and interpret scores. - Count objects in video zones: use
media-utilsfor video frames,detection-and-zonesforPolygonZone/LineZone,tracking-keypointswhen stabletracker_idis needed, andannotatorsfor overlays. - Debug backend/image/video issues: use
media-utilsfirst, then return to the workflow sub-skill that owns the higher-level operation.
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).