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 shrinked target in linknet + dilation in postprocessing #822

Merged
merged 7 commits into from
Feb 17, 2022

Conversation

charlesmindee
Copy link
Collaborator

Similarly to the DB, this PR includes a shrink of the polygons in the target and a dilation in the postprocessing of the linknet, to prevent boxes to be merged on the heatmap because their boundaries are too close.
After some experiments, this lead to much better results.
Any feedback is welcome!

@charlesmindee charlesmindee self-assigned this Feb 16, 2022
@charlesmindee charlesmindee added module: models Related to doctr.models topic: text detection Related to the task of text detection type: enhancement Improvement labels Feb 16, 2022
@charlesmindee charlesmindee added this to the 0.5.1 milestone Feb 16, 2022
@codecov
Copy link

codecov bot commented Feb 16, 2022

Codecov Report

Merging #822 (6ce142c) into main (612e4f8) will decrease coverage by 0.12%.
The diff coverage is 76.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
- Coverage   96.10%   95.97%   -0.13%     
==========================================
  Files         131      131              
  Lines        4949     4988      +39     
==========================================
+ Hits         4756     4787      +31     
- Misses        193      201       +8     
Flag Coverage Δ
unittests 95.97% <76.59%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
doctr/models/detection/linknet/base.py 88.79% <76.59%> (-4.72%) ⬇️

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 612e4f8...6ce142c. Read the comment docs.

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.

Perhaps we could do this in a smoother way by sharing the box shrink+dilation ops between the DB & LinkNet?

Because I feel like we're only adding duplicate lines of code here 😅

doctr/models/detection/linknet/base.py Outdated Show resolved Hide resolved
@charlesmindee
Copy link
Collaborator Author

I modified the typo, for the code duplicates there is only the polygon_to_box part in common, I suggest refactoring that in another PR

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 Charles!

@charlesmindee charlesmindee merged commit 41237e9 into main Feb 17, 2022
@charlesmindee charlesmindee deleted the shrink_linknet branch February 17, 2022 11:21
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: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants