Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Remove image padding after rotation correction with straighten_pages=True #1731

Merged

Conversation

felixdittrich92
Copy link
Contributor

@felixdittrich92 felixdittrich92 commented Sep 25, 2024

This PR:

  • Fix padding removal after rotation correction
  • Add function to remove the padding + corresponding test

Added as standalone function because of possible use later in another case instead of integration into rotate_image

Before:

Screenshot from 2024-09-25 08-45-05

After:

Screenshot from 2024-09-25 09-00-45

Any feedback is welcome 🤗

@felixdittrich92 felixdittrich92 added type: bug Something isn't working module: models Related to doctr.models module: utils Related to doctr.utils ext: tests Related to tests folder topic: text detection Related to the task of text detection labels Sep 25, 2024
@felixdittrich92 felixdittrich92 added this to the 0.9.1 milestone Sep 25, 2024
@felixdittrich92 felixdittrich92 self-assigned this Sep 25, 2024
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.40%. Comparing base (9045dcf) to head (489a7c4).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1731   +/-   ##
=======================================
  Coverage   96.40%   96.40%           
=======================================
  Files         164      164           
  Lines        7782     7823   +41     
=======================================
+ Hits         7502     7542   +40     
- Misses        280      281    +1     
Flag Coverage Δ
unittests 96.40% <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 Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Olivier Dulcy <106678676+odulcy-mindee@users.noreply.github.com>
@felixdittrich92
Copy link
Contributor Author

@odulcy-mindee btw the API fails actually (after the numpy 2.0 PR merge)

poetry install tf == 2.14 besides numpy 2.0 - which can't work 😅
and pip installs tf 2.15 besides numpy < 2.0 which is correct and works

Should we pin numpy < 2.0 in the api requirements or pyproject.toml for the moment ?
If the keras v3 stuff is done we can upgrade tf also and remove the pin

@felixdittrich92 felixdittrich92 merged commit df762ed into mindee:main Sep 30, 2024
80 of 81 checks passed
@felixdittrich92 felixdittrich92 deleted the straighten-pages-remove-border branch September 30, 2024 12:52
@felixdittrich92 felixdittrich92 modified the milestones: 0.9.1, 0.10.0 Oct 10, 2024
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: models Related to doctr.models module: utils Related to doctr.utils topic: text detection Related to the task of text detection type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants