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 FP16 support for doctr.models #382

Merged
merged 18 commits into from
Jul 19, 2021
Merged

feat: Added FP16 support for doctr.models #382

merged 18 commits into from
Jul 19, 2021

Conversation

fg-mindee
Copy link
Contributor

Following up on #263, this PR introduces the following modifications:

  • made dtype dynamic whenever possible
  • added error message for unknown dtype in preprocessors
  • added FP16 support to all models
  • updated unittests

Any feedback is welcome!

@fg-mindee fg-mindee added type: enhancement Improvement module: models Related to doctr.models ext: tests Related to tests folder framework: pytorch Related to PyTorch backend framework: tensorflow Related to TensorFlow backend labels Jul 13, 2021
@fg-mindee fg-mindee added this to the 0.3.1 milestone Jul 13, 2021
@fg-mindee fg-mindee self-assigned this Jul 13, 2021
@codecov
Copy link

codecov bot commented Jul 13, 2021

Codecov Report

Merging #382 (61ddf5d) into main (58a3f8d) will decrease coverage by 0.08%.
The diff coverage is 85.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #382      +/-   ##
==========================================
- Coverage   96.22%   96.14%   -0.09%     
==========================================
  Files          83       83              
  Lines        3554     3577      +23     
==========================================
+ Hits         3420     3439      +19     
- Misses        134      138       +4     
Flag Coverage Δ
unittests 96.14% <85.24%> (-0.09%) ⬇️

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

Impacted Files Coverage Δ
doctr/models/core.py 94.11% <ø> (ø)
doctr/models/recognition/transformer/tensorflow.py 88.11% <66.66%> (ø)
doctr/models/_utils.py 93.10% <75.00%> (ø)
doctr/models/detection/linknet/base.py 88.31% <75.00%> (ø)
doctr/models/preprocessor/pytorch.py 96.49% <81.81%> (-3.51%) ⬇️
doctr/models/preprocessor/tensorflow.py 96.36% <81.81%> (-3.64%) ⬇️
...dels/detection/differentiable_binarization/base.py 91.35% <88.88%> (+0.05%) ⬆️
doctr/models/detection/core.py 98.24% <100.00%> (ø)
...etection/differentiable_binarization/tensorflow.py 97.11% <100.00%> (ø)
doctr/models/detection/linknet/pytorch.py 96.90% <100.00%> (ø)
... and 7 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 58a3f8d...61ddf5d. 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!

@fg-mindee fg-mindee merged commit 6edceda into main Jul 19, 2021
@fg-mindee fg-mindee deleted the fp16 branch July 19, 2021 17:12
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 framework: tensorflow Related to TensorFlow backend module: models Related to doctr.models type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants