Skip to content

[io] Use the artefact confidence as the objectness score of a block without words - #2196

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:block-artefacts-objectness
Oct 30, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:block-artefacts-objectness

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

A Block with artefacts but no lines (supported since #2187) computed its objectness score as the mean of an empty list: NumPy warned Mean of empty slice and the score was NaN. json.dumps(page.export()) then wrote NaN, which is not valid JSON, and comparing the score to a threshold was always false.

Such a block now takes the mean confidence of its artefacts, the score with which they were detected. Blocks with words keep the mean objectness score of their words

@felixdittrich92 felixdittrich92 self-assigned this Oct 30, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 30, 2026
@felixdittrich92 felixdittrich92 added type: bug Something isn't working module: io Related to doctr.io ext: tests Related to tests folder labels Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.74%. Comparing base (6802eb8) to head (6ad2565).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2196   +/-   ##
=======================================
  Coverage   97.74%   97.74%           
=======================================
  Files         170      170           
  Lines       10964    10965    +1     
=======================================
+ Hits        10717    10718    +1     
  Misses        247      247           
Flag Coverage Δ
unittests 97.74% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@felixdittrich92
felixdittrich92 merged commit 23045f3 into mindee:main Oct 30, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: tests Related to tests folder module: io Related to doctr.io type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants