induwara.lk
induwara.lkAI · Machine learning

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.

By Induwara AshinsanaUpdated Jun 11, 2026
mAP calculator
Interpolation method

Class 1car

Each detection already matched against ground truth as TP or FP (e.g. at IoU ≥ 0.5). Separate with commas, spaces or new lines. 1 and 0 also work.

AP (all-point)
0.8333
VOC2010+ area
AP (11-point)
0.8409
VOC2007
Max recall
1.000
3/3 found
Reading
Strong

Precision–recall curve

raw interpolated
00.250.50.75100.250.50.751recall

precision (y) vs recall (x)

Cross-check. The recall-jump area sum gives AP(all-point) = 0.8333; the independent canonical VOC array method gives 0.8333. They reconcile, as they must. scikit-learn's non-interpolated AP for this class is 0.8056.

Precision–recall table

#LabelcumTPcumFPPrecisionRecallp_interp
1TP101.0000.3331.000
2FP110.5000.3330.750
3TP210.6670.6670.750
4TP310.7501.0000.750
5FP320.6001.0000.600
1 / 20 classes · mAP needs at least 2
Examples
AP(all-point)=0.8333, AP(11-point)=0.8409

Method: precision Pᵢ = cumTP / (cumTP + cumFP), recall Rᵢ = cumTP / G, AP = area under the interpolated precision–recall curve (PASCAL VOC), mAP = mean of per-class AP. Detections are taken in the order you supply (highest confidence first); nothing leaves this page.

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:

  1. Precision. Pᵢ = cumTPᵢ / (cumTPᵢ + cumFPᵢ) — the share of detections so far that are correct.
  2. Recall. Rᵢ = cumTPᵢ / G — the share of all real objects found so far.
  3. 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.
  4. 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).
  5. 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

Single class — labels = TP, FP, TP, TP, FP, G = 3

  1. rows (P, R): (1.000, .333) (0.500, .333) (0.667, .667) (0.750, 1.0) (0.600, 1.0)
  2. envelope p_interp (max P from the right) = [1.000, 0.750, 0.750, 0.750, 0.600]
  3. recall rises at #1 (0→.333), #3 (.333→.667), #4 (.667→1)
  4. AP(all-point) = (.333)·1.000 + (.334)·0.750 + (.333)·0.750 = 0.8333
  5. 11-point: p_interp = 1.000 at r=0,.1,.2,.3; 0.750 at r=.4…1.0
  6. AP(11-point) = (4·1.000 + 7·0.750) / 11 = 9.25 / 11 = 0.8409

Two classes → mAP. Class B labels = TP, TP, FP, G = 2

  1. Class B rows (P, R): (1.000, .5) (1.000, 1.0) (0.667, 1.0)
  2. envelope is flat at 1.000 up to recall 1.0
  3. AP_B(all-point) = (.5)·1.000 + (.5)·1.000 = 1.000
  4. Class A (above) AP = 0.8333
  5. mAP(all-point) = (0.8333 + 1.000) / 2 = 0.9167

Edge case — recall capped, labels = TP, FP, G = 4

  1. rows (P, R): (1.000, 0.25) (0.500, 0.25) — only 1 TP out of 4 real objects
  2. envelope = [1.000, 0.500]; recall never exceeds 0.25
  3. AP(all-point) = (0.25)·1.000 = 0.2500 (area stops at max recall)
  4. 11-point: p_interp = 1.000 at r=0,.1,.2; 0 at r ≥ .3 → 3·1.000 / 11
  5. AP(11-point) = 0.2727 — the conventions legitimately differ here

Frequently asked questions

Sources & references

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

Rate this tool
Be the first to rate

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.