AGENT SKILL

metrics

Use supervision metrics for detection evaluation, benchmarking, and result interpretation.

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

01 前言 Front Matter

name
metrics
license
MIT
metadata
{ "disco-role": "operating" }
description
Use supervision metrics for detection evaluation, benchmarking, and result interpretation.
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

Metrics

Use this sub-skill when a task asks to evaluate object detection, instance segmentation, or oriented-box predictions with supervision metrics in version 0.31.0.dev0 on Python >=3.10.

Route here for

  • MeanAveragePrecision, MeanAverageRecall, Precision, Recall, F1Score, result objects, .update(...), .compute(), .reset(), .to_pandas(), or .plot().
  • MetricTarget.BOXES, MetricTarget.MASKS, MetricTarget.ORIENTED_BOUNDING_BOXES, and AveragingMethod choices.
  • sv.ConfusionMatrix, confusion-matrix plots, confidence/IoU thresholds, and per-image validation grids from ConfusionMatrix.benchmark(...).
  • Dataset-backed benchmark loops that already have or can obtain pairs of prediction and target Detections.
  • Diagnosing mAP, mAR, precision, recall, F1, per-class rows, weighted versus macro/micro averaging, empty inputs, class-id mapping, masks, OBB metrics, COCO-style area, iscrowd, and ignore behavior.

Route away

  • Dataset loading, splitting, merging, or format conversion: use datasets, then return here with DetectionDataset samples or Detections target lists.
  • Model inference, framework adapters, VLM parsing, detection filtering, NMS, masks/OBB container construction, zones, slicers, or sinks: use detection-and-zones, then return here with prediction Detections.
  • High-level false-positive/false-negative drawing or side-by-side visual style: use annotators after metrics identify the detections to display.
  • Low-level image/video I/O, plotting grids, or OpenCV backend diagnosis: use media-utils when the task is not metric-specific.

Start with these references

  • Metrics reference for metric classes, required Detections fields, result attributes, targets, averaging, and COCO-style metadata.
  • Workflows for update/compute patterns, dataset-backed benchmark loops, class remapping, mask/OBB evaluation, confusion matrices, pandas export, and plotting.
  • Troubleshooting for metrics extra/pandas, missing confidence or class_id, wrong MetricTarget, mask/OBB metadata, class mappings, empty inputs, and visualization issues.

Operating defaults

  1. Install the metrics extra before metric work: pip install "supervision[metrics]". The base install is pip install supervision, but .to_pandas() needs pandas from the metrics extra.
  2. Prefer the newer metrics package imports: from supervision.metrics import MeanAveragePrecision, MeanAverageRecall, Precision, Recall, F1Score, MetricTarget, AveragingMethod. Do not use the legacy top-level sv.MeanAveragePrecision for new mAP code.
  3. Predictions must normally include xyxy, class_id, and confidence. Targets must include xyxy and class_id; target confidence is not required.
  4. Choose the metric target deliberately. BOXES uses detections.xyxy, MASKS uses detections.mask, and ORIENTED_BOUNDING_BOXES uses detections.data[ORIENTED_BOX_COORDINATES].
  5. Keep class ids aligned with the dataset class list before computing metrics. ConfusionMatrix requires ids in [0, len(classes) - 1]; new metric result rows are keyed by matched_classes rather than by row position alone.
  6. Do not promise network/model benchmark execution unless the user already provides a runnable model and local dataset. This skill owns evaluation logic, not model acquisition or data download.

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