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: Fixed MASTER recognition architecture #687

Merged
merged 16 commits into from
Dec 10, 2021
Merged

fix: Fixed MASTER recognition architecture #687

merged 16 commits into from
Dec 10, 2021

Conversation

fg-mindee
Copy link
Contributor

@fg-mindee fg-mindee commented Dec 9, 2021

This PR introduces the following modifications:

  • fixed PyTorch implementation of MAGC module
  • refactored MASTER to use magc_resnet31 backbone added to available backbones, and adds pretrained_backbone option
  • fixed TF compatibility with AMP for MASTER
  • updated unittests accordingly

Any feedback is welcome!

@fg-mindee fg-mindee added type: bug Something isn't working topic: documentation Improvements or additions to documentation module: models Related to doctr.models framework: pytorch Related to PyTorch backend framework: tensorflow Related to TensorFlow backend topic: text recognition Related to the task of text recognition labels Dec 9, 2021
@fg-mindee fg-mindee added this to the 0.5.0 milestone Dec 9, 2021
@fg-mindee fg-mindee self-assigned this Dec 9, 2021
charlesmindee
charlesmindee previously approved these changes Dec 9, 2021
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!

@fg-mindee
Copy link
Contributor Author

Actually, the paper references the ResNet31 architecture which has 256 channels in stage 2, but in the MASTER paper (Table1) they modified the stage 2 to have 512 channels.

So I reverted back those changes and added back the URL & benchmark perf

charlesmindee
charlesmindee previously approved these changes Dec 9, 2021
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 revert

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!

@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #687 (b90d635) into main (9c45ba6) will decrease coverage by 0.33%.
The diff coverage is 99.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
- Coverage   96.40%   96.07%   -0.34%     
==========================================
  Files         117      120       +3     
  Lines        4540     4589      +49     
==========================================
+ Hits         4377     4409      +32     
- Misses        163      180      +17     
Flag Coverage Δ
unittests 96.07% <99.23%> (-0.34%) ⬇️

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

Impacted Files Coverage Δ
doctr/models/recognition/crnn/pytorch.py 94.18% <ø> (-5.82%) ⬇️
doctr/models/recognition/transformer/tensorflow.py 88.11% <50.00%> (ø)
doctr/models/backbones/__init__.py 100.00% <100.00%> (ø)
doctr/models/backbones/magc_resnet/__init__.py 100.00% <100.00%> (ø)
doctr/models/backbones/magc_resnet/pytorch.py 100.00% <100.00%> (ø)
doctr/models/backbones/magc_resnet/tensorflow.py 100.00% <100.00%> (ø)
doctr/models/recognition/master/pytorch.py 91.58% <100.00%> (-4.00%) ⬇️
doctr/models/recognition/master/tensorflow.py 95.28% <100.00%> (-1.23%) ⬇️
...dels/detection/differentiable_binarization/base.py 89.44% <0.00%> (-3.34%) ⬇️
... and 4 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 9c45ba6...b90d635. Read the comment docs.

@fg-mindee fg-mindee merged commit 6360bde into main Dec 10, 2021
@fg-mindee fg-mindee deleted the master-refactor branch December 10, 2021 10:17
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 framework: tensorflow Related to TensorFlow backend module: models Related to doctr.models topic: documentation Improvements or additions to documentation topic: text recognition Related to the task of text recognition type: bug Something isn't working
Projects
None yet
2 participants