file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
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 资源文件 3
- 参考文档references/file-format.md4.6 KB
- 参考文档references/troubleshooting.md5.3 KB
- 参考文档references/workflows.md6.3 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
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.