Repository navigation
fix(metrics): leave crowd and ignored targets out of MeanAverageRecall - #2750
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2750 +/- ##
=======================================
Coverage 94% 94%
=======================================
Files 83 83
Lines 13612 13633 +21
=======================================
+ Hits 12807 12828 +21
Misses 805 805 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused correction preserves prediction limits, includes regression coverage, and has no unresolved findings.
0 open findings
What changed in this PR
Updates MeanAverageRecall to exclude crowd and ignored targets, aligning this aspect of recall with COCO evaluation while preserving prediction limits.
Changes:
- Removes ignored targets before size filtering and recall calculation.
- Adds regression tests for ignored targets and crowd-only classes.
- Documents the behavior in the class docstring and changelog.
| File | Description |
|---|---|
| tests/metrics/test_mean_average_recall.py | Adds crowd and ignore regression tests. |
| src/supervision/metrics/mean_average_recall.py | Filters ignored targets and documents the behavior. |
| docs/changelog.md | Records the recall correction. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks for pointing out the remaining matching-order difference. I reproduced it in a small example without crowd or ignored targets and opened #2758 to address it. |
8dbb814 to
09c0caa
Compare
Changes: - Match each top-ranked prediction to its best eligible unmatched same-class target for each IoU threshold and detection limit. - Use a fully qualified Sphinx role for the COCO dataset loader and add a regression test and changelog entry for confidence-order behavior. Impact: - MeanAverageRecall now follows confidence-first matching, so a lower-confidence prediction cannot claim a target before a higher-confidence prediction. - The dataset loader reference renders as a navigable API link. Verification: - Ruff lint, full pre-commit, and mypy passed. - Full coverage suite passed: 5,733 passed, 123 skipped, 94% total coverage. - Offline MkDocs render passed and the generated mAR page contains the fully qualified method target. Residual limits: - pycocotools runtime parity was unavailable; the strict full-site build could not reach GitHub through the git-committers plugin. The docs render passed with that metadata plugin disabled. --- Co-authored-by: Codex <[email protected]>
MeanAverageRecall
Changes: - Merge target roboflow#2750 and roboflow#2752 metrics behavior and regression coverage into the PR branch. - Retain the PR roboflow#2755 grayscale annotator changelog entry alongside target metrics release notes. Impact: - Keeps the PR branch current with develop while preserving both PR and target behavior. - Retains release notes for grayscale annotator and metrics changes in one Unreleased section. Verification: - `git merge-tree` identified one changelog conflict; the resolution keeps all three independent entries. - Reviewed the five-path merge index; no unmerged paths remain and `git diff --cached --check` passes. Residual limits: - The conflict was documentation-only; merged target code remains subject to this remediation run's quality gates. --- Co-authored-by: Codex <[email protected]>
…ll` (#2750) * fix(metrics): leave crowd and ignored targets out of MeanAverageRecall * docs(changelog): note MeanAverageRecall crowd handling (#2750) * fix(metrics): match recall predictions by confidence --------- Co-authored-by: Lingikaushikreddy <[email protected]> Co-authored-by: jirka <[email protected]> Co-authored-by: Codex <[email protected]>
Description
MeanAverageRecallnow leaves COCO ignore regions out of recall. These are targets withdata["iscrowd"]ordata["ignore"]set, the same ruleMeanAveragePrecisionapplies. They were counted as misses, so mAR on COCO data with crowd annotations came out lower thanpycocotoolsAR. With one normal target, one crowd target and a perfect prediction,mAR_at_100was 0.5;pycocotoolsgives 1.0, and so does this PR.Motivation and Context
Closes #2749
DetectionDataset.from_cocokeepsiscrowdby default, and #2689 / #2701 setpycocotoolsAR as the reference for this metric.Changes Made
MeanAverageRecall._computedrops ignore-region targets before the size filter, through a new_drop_ignored_targets.ignoretargets are not misses; a class with only crowd targets is left out of the mean.docs/changelog.mdentry.Precision,RecallandF1Scorealso ignoreiscrowd. They aren't COCO metrics, so I left them alone. Happy to follow up if you want the same rule there.Testing
New tests on
develop: all 3 fail with recall[0.5, 0.5, 0.5]instead of[1, 1, 1].With this change:
uv run pytest tests/metrics, 661 passed. Full suite:uv run pytest, 5697 passed, 105 skipped (develop: 5694 passed, 105 skipped).Against
pycocotools2.0.11 on a seeded harness (0–3 crowd targets per image, 100 trials, boxes):develop: mismatches in 77 trials.MeanAverageRecalldetections per image and class #2701 noted. I'll file that separately.uv run pre-commit run --all-filespasses.Added/updated tests, and the full suite passes locally
Updated docs (docstrings / mkdocs entry) for new or changed public API
Added a changelog entry in
docs/changelog.mdunderUnreleased