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: Added recognition postprocessor with CTC decoder #37

Merged
merged 10 commits into from
Jan 25, 2021

Conversation

charlesmindee
Copy link
Collaborator

Implements CTC decoder with keras backend to decode raw output of CRNN model.
postprocessor input: raw tensor (CRNN output), output: list of words (strings), size = batch_size

@charlesmindee charlesmindee added the module: models Related to doctr.models label Jan 25, 2021
@charlesmindee charlesmindee self-assigned this Jan 25, 2021
@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #37 (591c114) into main (05d6f4f) will decrease coverage by 0.29%.
The diff coverage is 94.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
- Coverage   97.84%   97.54%   -0.30%     
==========================================
  Files          17       18       +1     
  Lines         371      408      +37     
==========================================
+ Hits          363      398      +35     
- Misses          8       10       +2     
Impacted Files Coverage Δ
doctr/models/recognition/postprocessor.py 94.44% <94.44%> (ø)
doctr/models/recognition/__init__.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 05d6f4f...591c114. 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.

Thanks for the PR! I left a few comments, but I'm wondering here: if this is specific to CRNN, then we should put specific parts into the crnn.py file. And I feel like your postprocessing function, could be a class (at init, we can already set num_classes, label_to_dict, ignore_case, ignore_accents, so that the call method only takes logits as inputs)

doctr/models/recognition/postprocessor.py Outdated Show resolved Hide resolved
@fg-mindee fg-mindee changed the title Postprocess recognition : CTC decoder feat: Added recognition postprocessor with CTC decoder Jan 25, 2021
@fg-mindee fg-mindee added this to the 0.1.0 milestone Jan 25, 2021
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 for the edits! LGTM

@charlesmindee charlesmindee merged commit 3284dca into main Jan 25, 2021
@charlesmindee charlesmindee deleted the postprocess_reco branch January 25, 2021 13:26
@fg-mindee fg-mindee mentioned this pull request Jan 26, 2021
4 tasks
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants