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

refactor: ⚡ Speeded up CTC decoding in PyTorch by x10 #633

Merged
merged 7 commits into from
Nov 18, 2021
Merged

Conversation

fg-mindee
Copy link
Contributor

This PR introduces the following modifications:

  • extends arg type support of decode_sequence
  • refactored CTC decoding in PyTorch bringing a 10x speedup
  • updated unittests

Any feedback is welcome!

@fg-mindee fg-mindee added type: enhancement Improvement module: models Related to doctr.models module: datasets Related to doctr.datasets framework: pytorch Related to PyTorch backend topic: text recognition Related to the task of text recognition labels Nov 17, 2021
@fg-mindee fg-mindee added this to the 0.5.0 milestone Nov 17, 2021
@fg-mindee fg-mindee self-assigned this Nov 17, 2021
@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #633 (bbf5676) into main (16d842e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #633      +/-   ##
==========================================
+ Coverage   96.05%   96.07%   +0.02%     
==========================================
  Files         112      112              
  Lines        4359     4357       -2     
==========================================
- Hits         4187     4186       -1     
+ Misses        172      171       -1     
Flag Coverage Δ
unittests 96.07% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
doctr/datasets/utils.py 94.73% <100.00%> (+2.42%) ⬆️
doctr/models/recognition/crnn/pytorch.py 100.00% <100.00%> (ø)

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 16d842e...bbf5676. Read the comment docs.

Copy link
Collaborator

@charlesmindee charlesmindee left a comment

Choose a reason for hiding this comment

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

thanks for the refactor!

@fg-mindee fg-mindee merged commit 8b6dac3 into main Nov 18, 2021
@fg-mindee fg-mindee deleted the ctc-decode branch November 18, 2021 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: pytorch Related to PyTorch backend module: datasets Related to doctr.datasets module: models Related to doctr.models topic: text recognition Related to the task of text recognition type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants