Mean Average Precision (mAP) Calculator
Paste a ranked list of TP/FP detections and a ground-truth count to get Average Precision and mean Average Precision, the full precision–recall table, and both 11-point and all-point interpolation. Matches PASCAL VOC. No signup, nothing uploaded.
How it works
Average Precision (AP)summarises a detector's precision–recall curve for one class as a single number; mean Average Precision (mAP) averages AP over all classes. This tool takes detections you have already matched to ground truth as true positives (TP) or false positives (FP) — for example at IoU ≥ 0.5 — in confidence-descending order, and follows the definitions in the PASCAL VOC challenge (Everingham et al., 2010) and COCO evaluation.
Let G be the ground-truth positive count for the class. Walking the ranked list from the top, the tool accumulates true and false positives and, at each rank i, records:
- Precision.
Pᵢ = cumTPᵢ / (cumTPᵢ + cumFPᵢ)— the share of detections so far that are correct. - Recall.
Rᵢ = cumTPᵢ / G— the share of all real objects found so far. - Interpolated precision. Make precision monotonically non-increasing from the right:
p_interp(r) = max{ Pⱼ : Rⱼ ≥ r }. This removes the zig-zag so a later, higher precision lifts earlier points. - Average Precision. The all-point AP (PASCAL VOC 2010+, the COCO area method) is the area under that interpolated curve:
AP = Σₙ (Rₙ − Rₙ₋₁)·p_interp(Rₙ), summed where recall increases with R₀ = 0. The 11-point AP (PASCAL VOC 2007) instead averages p_interp at recall 0, 0.1, … 1.0:AP = (1/11)·Σ p_interp(r). - mAP. Repeat per class and take the unweighted mean:
mAP = (1/C)·Σ_c AP_c.
A subtlety worth knowing: scikit-learn's average_precision_score uses the non-interpolated step sum Σ (Rₙ − Rₙ₋₁)·Pₙ (precision at each threshold, no envelope), which can differ slightly from the VOC interpolated area. The calculator shows that value separately so numbers reconcile with whichever library you compare against. COCO uses the same VOC2010 envelope but samples it at 101 recall points; the area version here is the continuous limit of that. As a credibility check, the all-point AP is computed twice — once by summing recall-jump rectangles and once by the canonical VOC array method — and the page confirms the two agree to floating-point precision. This version computes AP at a single operating point; the full COCO [email protected]:0.95 sweep across IoU thresholds needs per-box IoU inputs, which the IoU calculator covers.
Worked examples
Frequently asked questions
Sources & references
- PASCAL VOC Challenge (Everingham et al., 2010) — the AP definition, VOC2007 11-point and VOC2010+ all-point interpolation
- COCO detection evaluation — AP over IoU 0.50:0.05:0.95, [email protected], and mAP as the mean of per-class AP
- scikit-learn — average_precision_score: the non-interpolated step-sum AP shown alongside the VOC area
The formulas on this page were last cross-checked against these sources on 2026-06-11. AP and mAP are stable mathematical definitions, so this tool needs no rate or schedule updates — only the worked examples are periodically re-reconciled against the PASCAL VOC dev-kit.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.