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: box angle rectification according to the quadrant #667

Merged
merged 7 commits into from
Dec 3, 2021

Conversation

charlesmindee
Copy link
Collaborator

This PR provides an heuristic to determine the quadrant of the document (only 2 quadrants are allowed, +90 and -90 with respect to the horizontal). The quadrant is determined with the median aspect ratio of cv2 min area rect, and then we can rectify boxes knowing the quadrant.
This is not a long-term fix, we should add a classifier to resolve the angle of each box perfectly, but for the moment I couldn't find anything else to fix this issue.

Any feedback is welcome!

@charlesmindee charlesmindee self-assigned this Dec 1, 2021
@charlesmindee charlesmindee added type: bug Something isn't working module: models Related to doctr.models topic: text detection Related to the task of text detection labels Dec 1, 2021
@charlesmindee charlesmindee added this to the 0.5.0 milestone Dec 1, 2021
@fg-mindee
Copy link
Contributor

@charlesmindee there is still a failing job for the analysis script :/

@charlesmindee
Copy link
Collaborator Author

Yes I need to debug everything, I'll tell you when it's ready!

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #667 (15cb573) into main (8eb89e8) will decrease coverage by 0.09%.
The diff coverage is 73.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #667      +/-   ##
==========================================
- Coverage   96.35%   96.25%   -0.10%     
==========================================
  Files         117      117              
  Lines        4466     4485      +19     
==========================================
+ Hits         4303     4317      +14     
- Misses        163      168       +5     
Flag Coverage Δ
unittests 96.25% <73.68%> (-0.10%) ⬇️

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

Impacted Files Coverage Δ
...dels/detection/differentiable_binarization/base.py 90.00% <73.68%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8eb89e8...15cb573. Read the comment docs.

@charlesmindee
Copy link
Collaborator Author

It should be OK!

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

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

Thanks! I added a few comments, could you add an illustration in the PR?
It's hard without drawing the reasoning behind this 😅

@charlesmindee
Copy link
Collaborator Author

1638526009027

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@charlesmindee charlesmindee merged commit 9f72984 into main Dec 3, 2021
@charlesmindee charlesmindee deleted the fix_boxes branch December 3, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: models Related to doctr.models 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.

None yet

2 participants