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

feat: add rotated ckpts for pytorch DBNet + fix line resolution for rotated pages #743

Merged
merged 55 commits into from
Dec 29, 2021

Conversation

charlesmindee
Copy link
Collaborator

This PR adds rotated ckpts in the db_resnet50 cfg in torch, and fixes the document builder:

  • fixes the angle computation to straighten boxes when resolving lines
  • fixes the order of points in the rotated polygons (rectify_loc_preds function)
  • fixes the line resolution

to be merged after #731
Any feedback is welcome!

@charlesmindee charlesmindee self-assigned this Dec 23, 2021
@charlesmindee charlesmindee added the type: enhancement Improvement label Dec 23, 2021
@codecov
Copy link

codecov bot commented Dec 24, 2021

Codecov Report

Merging #743 (2d16432) into main (f2f1f21) will decrease coverage by 0.08%.
The diff coverage is 91.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #743      +/-   ##
==========================================
- Coverage   96.19%   96.10%   -0.09%     
==========================================
  Files         129      129              
  Lines        4810     4805       -5     
==========================================
- Hits         4627     4618       -9     
- Misses        183      187       +4     
Flag Coverage Δ
unittests 96.10% <91.42%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
doctr/datasets/detection.py 93.75% <ø> (ø)
doctr/models/_utils.py 97.59% <ø> (-1.21%) ⬇️
...s/detection/differentiable_binarization/pytorch.py 97.60% <66.66%> (-0.78%) ⬇️
doctr/models/detection/zoo.py 96.00% <80.00%> (-4.00%) ⬇️
doctr/utils/visualization.py 90.26% <80.00%> (-0.73%) ⬇️
doctr/io/elements.py 92.09% <100.00%> (ø)
doctr/models/builder.py 99.01% <100.00%> (-0.12%) ⬇️
...dels/detection/differentiable_binarization/base.py 93.49% <100.00%> (ø)
doctr/utils/geometry.py 98.73% <100.00%> (ø)
... and 1 more

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 f2f1f21...2d16432. Read the comment docs.

@fg-mindee fg-mindee linked an issue Dec 26, 2021 that may be closed by this pull request
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 a lot! Minor improvement suggestions in the review 👍

doctr/models/_utils.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/utils/visualization.py Outdated Show resolved Hide resolved
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, only minor changes left! Still some CI jobs failing though

doctr/models/builder.py Outdated Show resolved Hide resolved
doctr/transforms/modules/tensorflow.py Outdated Show resolved Hide resolved
doctr/models/_utils.py Outdated Show resolved Hide resolved
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.

Thank a lot for all this work!

@charlesmindee charlesmindee merged commit 1dc3374 into main Dec 29, 2021
@charlesmindee charlesmindee deleted the rot-ckpt branch December 29, 2021 13:31
@fg-mindee fg-mindee added ext: tests Related to tests folder module: io Related to doctr.io module: utils Related to doctr.utils type: bug Something isn't working type: new feature New feature and removed module: utils Related to doctr.utils type: enhancement Improvement labels Dec 31, 2021
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 framework: pytorch Related to PyTorch backend module: io Related to doctr.io 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 type: new feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[models] detect page orientation
2 participants