Skip to content

fix(metrics): use COCO eval index 8 for AR50_90 in MetricsMLFlowSink - #735

Merged
Borda merged 1 commit into
roboflow:developfrom
tillfri:develop
Feb 26, 2026
Merged

Borda merged 1 commit into
roboflow:developfrom
tillfri:develop

Conversation

@tillfri

@tillfri tillfri commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

fix Issue #734

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

@CLAassistant

CLAassistant commented Feb 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Borda Borda added the bug Something isn't working label Feb 24, 2026
@Borda

Borda commented Feb 24, 2026

Copy link
Copy Markdown
Member

Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@tillfri ^^ 🦝

@codecov

codecov Bot commented Feb 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 65%. Comparing base (0186f49) to head (3d70906).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@          Coverage Diff           @@
##           develop   #735   +/-   ##
======================================
  Coverage       65%    65%           
======================================
  Files           56     56           
  Lines         7207   7207           
======================================
+ Hits          4692   4693    +1     
+ Misses        2515   2514    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tillfri

tillfri commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@tillfri ^^ 🦝

I have signed it, got an Internal Server Error earlier 😅 Signed it again, this time it worked (i think), hopefully it just takes some time to update :D

@Borda

Borda commented Feb 25, 2026

Copy link
Copy Markdown
Member

@tillfri seems CLI was not still update, could you pls do it again 🙏

@tillfri

tillfri commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

@tillfri seems CLI was not still update, could you pls do it again 🙏

I have tried multiple times, with different devices, supposedly successful, but status is not changing😅
maybe because i had not set any email address in the commit, otherwise i am clueless
swappy-20260224_182001

@Borda

Borda commented Feb 25, 2026

Copy link
Copy Markdown
Member

I see, and I guess that the problem is that the GH does not match your commitment to your profile
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect COCO Average Recall logging in the MLflow metrics sink (Issue #734) so that AR50_90 matches the same COCOeval stats entry used by the other logging sinks.

Changes:

  • Update MetricsMLFlowSink to read AR50_90 from COCOeval stats[8] (AR @ maxDets=100) instead of stats[6].
  • Apply the same correction for EMA COCO eval metrics.
Comments suppressed due to low confidence (1)

src/rfdetr/util/metrics.py:395

  • There’s no regression test covering the COCO stats index used for Metrics/*/AR50_90 in MetricsMLFlowSink.update. Adding a small unit test that feeds a dummy test_coco_eval_bbox array with distinct values at indices 6/8 and asserts that AR50_90 logs the index-8 value would prevent this from silently regressing again (ideally without requiring the real mlflow dependency, e.g., by monkeypatching the module).
            ema_coco_eval = values["ema_test_coco_eval_bbox"]
            ema_ap50_90 = safe_index(ema_coco_eval, 0)
            ema_ap50 = safe_index(ema_coco_eval, 1)
            ema_ar50_90 = safe_index(ema_coco_eval, 8)
            if ema_ap50_90 is not None:
                metrics_dict["Metrics/EMA/AP50_90"] = ema_ap50_90
            if ema_ap50 is not None:
                metrics_dict["Metrics/EMA/AP50"] = ema_ap50
            if ema_ar50_90 is not None:
                metrics_dict["Metrics/EMA/AR50_90"] = ema_ar50_90

Comment on lines 374 to 378
coco_eval = values["test_coco_eval_bbox"]
ap50_90 = safe_index(coco_eval, 0)
ap50 = safe_index(coco_eval, 1)
ar50_90 = safe_index(coco_eval, 6)
ar50_90 = safe_index(coco_eval, 8)
if ap50_90 is not None:

Copilot AI Feb 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider avoiding hard-coded COCOeval stats indices here. This bug happened because the MLflow sink diverged from other sinks; defining named module-level constants (e.g., COCO_STATS_AP_50_95_IDX=0, COCO_STATS_AP_50_IDX=1, COCO_STATS_AR_50_95_MAX100_IDX=8) and reusing them across all sinks would reduce the chance of future mismatches and improve readability.

Copilot uses AI. Check for mistakes.
@tillfri

tillfri commented Feb 26, 2026

Copy link
Copy Markdown
Contributor Author

I see, and I guess that the problem is that the GH does not match your commitment to your profile image

I fixed it by force pushing the same commit with --ammend --reset-author --no-edit, sorry for the inconvenience, i was not on my usual device

@Borda
Borda merged commit 52b7b8f into roboflow:develop Feb 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants