Skip to content

refactor: update metrics logic#260

Merged
ktro2828 merged 1 commit into
feat/evaluation/mainfrom
refactor/evaluation/metrics
Jan 29, 2026
Merged

refactor: update metrics logic#260
ktro2828 merged 1 commit into
feat/evaluation/mainfrom
refactor/evaluation/metrics

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

What

This pull request refactors the buffer update logic in the evaluation metrics codebase, improving code modularity and maintainability. The main changes involve extracting buffer update logic into helper methods for both the Average Precision (AP) and CLEAR metrics, as well as fixing an argument issue in a helper method call.

Refactoring buffer update logic:

  • Extracted per-frame buffer update logic into a new _update_buffer_frame helper method in Ap class (t4_devkit/evaluation/metric/ap.py). The main _update_buffer method now delegates frame updates to this helper for improved modularity. [1] [2]
  • Similarly, extracted per-frame buffer update logic into a new _update_buffer_frame helper method in Clear class (t4_devkit/evaluation/metric/clear.py). The main _update_buffer method now uses this helper. [1] [2]

Bug fix:

  • Fixed a bug in the call to _is_same_match in Clear class by passing the correct arguments (current_match, previous_match).

Other:

  • Added a TODO comment for future support of prediction in the dataset loader.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@github-actions github-actions Bot added the refactor Refactoring code or increasing performance label Jan 29, 2026
@github-actions

github-actions Bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ❌

Overall Coverage

Lines Covered Coverage Threshold Status
4718 3910 83% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/evaluation/dataset.py 95% 🟢
t4_devkit/evaluation/metric/ap.py 96% 🟢
t4_devkit/evaluation/metric/clear.py 49% 🔴
TOTAL 80% 🔴

updated for commit: b3fa68f by action🐍

@ktro2828 ktro2828 merged commit cea0e40 into feat/evaluation/main Jan 29, 2026
5 checks passed
@ktro2828 ktro2828 deleted the refactor/evaluation/metrics branch January 29, 2026 17:03
ktro2828 added a commit that referenced this pull request Feb 11, 2026
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code or increasing performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant