file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- file-evaluation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/file-format.md4.6 KB
- 参考文档references/troubleshooting.md5.3 KB
- 参考文档references/workflows.md6.3 KB
- 脚本scripts/voc_metrics_eval.py18.1 KB
03 SKILL.md 正文
file-evaluation
Use this sub-skill when the user wants PASCAL VOC Average Precision (AP) or mean AP (mAP) from folders of ground-truth and detection .txt files, including YOLO-style relative detections, mixed xywh/xyrb coordinate formats, or a noninteractive replacement for the legacy pascalvoc.py workflow.
Route here for
- Compute VOC AP or mAP from
groundtruths/anddetections/text folders. - Evaluate detection text files with an IoU threshold such as
0.3,0.5, or0.75. - Convert relative YOLO-like
center_x center_y width heightboxes to VOC AP/mAP with a fixed image size. - Avoid the original script's save-path prompt/deletion and plotting behavior.
Route away
- Direct construction of
BoundingBox,BoundingBoxes, orEvaluatorobjects, custom in-memory metrics, 11-point AP choices, or drawing/plotting API behavior: use../python-api/SKILL.md. - COCO metrics, successor UI/new-tool workflows, video metrics, model training, or detector inference are outside this legacy sub-skill.
Required inputs
- A ground-truth folder containing one
.txtfile per image id. - A detection folder containing one
.txtfile per image id. - The coordinate format for each folder:
xywh: absoluteleft top width height; for relative coordinates this means YOLO-stylecenter_x center_y width height.xyrb: absoluteleft top right bottom/XYX2Y2.
- Coordinate reference for each folder:
absorrel. WIDTH,HEIGHTimage size if either folder usesrelcoordinates.- IoU threshold for TP/FP matching. Default is
0.5.
See references/file-format.md for exact schemas, matching rules, and relative-coordinate conversion.
Noninteractive helper
The bundled helper is self-contained and uses only the Python standard library:
python scripts/voc_metrics_eval.py \
--gt-folder /path/to/groundtruths \
--det-folder /path/to/detections \
--threshold 0.5 \
--gt-format xywh --det-format xywh \
--gt-coords abs --det-coords abs \
--output-text voc-results.txt \
--output-json voc-results.json \
--pretty
For YOLO-like relative detections against absolute ground truth:
python scripts/voc_metrics_eval.py \
--gt-folder /path/to/groundtruths \
--det-folder /path/to/detections_rel \
--threshold 0.3 \
--gt-format xywh --det-format xywh \
--gt-coords abs --det-coords rel \
--img-size 200,200 \
--output-text voc-results.txt
The helper never plots, never prompts, and never deletes an output directory. It prints to stdout when no output file is requested and creates only the explicit --output-text and/or --output-json files.
Output contract
Text output contains:
- IoU threshold.
- Any validation warnings, such as unmatched file stems.
- Per-class AP percentage, precision array, recall array, total positives, total TP, and total FP.
- Final
mAPpercentage.
JSON output contains:
metric,threshold,classes,valid_classes,ignored_classes,mAP,mAP_percent, andwarnings.- Each item in
classesincludesclass,AP,AP_percent,precision,recall,interpolated_precision,interpolated_recall,total positives,total TP, andtotal FP.
Evaluation semantics
- AP uses VOC every-point interpolation, the default behavior of the legacy toolkit.
- IoU uses inclusive VOC pixel area (
+1in width and height). - Detections are sorted by descending confidence within each class.
- A ground-truth box can be matched once. Duplicate detections of the same object become false positives after the first match.
- mAP is the mean of AP values over classes with at least one ground-truth positive; detection-only classes are ignored with a warning.
Standard workflow
- Validate folder existence and text-line schema before running.
- Confirm file stems match image ids across ground-truth and detection folders.
- Select
--gt-formatand--det-format; wrongxywhvsxyrbselection can silently change IoU/AP. - If using
rel, add--img-size WIDTH,HEIGHTand keep formatxywh. - Run the helper with
--output-jsonfor machine-readable reports or--output-textfor a VOC-like summary. - Interpret AP/mAP using
references/workflows.md; troubleshoot failures usingreferences/troubleshooting.md.
Evidence distilled
This sub-skill is distilled from the repository's README.md PASCAL VOC metrics and CLI guidance, pascalvoc.py parser/evaluation behavior, the tiny text fixtures in groundtruths/, detections/, groundtruths_rel/, detections_rel/, samples/sample_2/README.md, and the sample output shape in results/results.txt.
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).