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 to doctr.datasets #367

Merged
merged 9 commits into from
Jul 7, 2021
Merged

feat: Added FP16 support to doctr.datasets #367

merged 9 commits into from
Jul 7, 2021

Conversation

fg-mindee
Copy link
Contributor

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

  • switched default image dtype of TF datasets to FP32 (before it was tf.uint8)
  • added FP16 mode on all datasets
  • added corresponding unittests
  • updated references script to reflect changes (no need to perform 255 division manually anymore)

Please note that there is a breaking change here, the default image dtype of datasets in TF has been switched from tf.uint8 (between 0 and 255) to tf.float32 (between 0 and 1).

Any feedback is welcome!

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

codecov bot commented Jul 7, 2021

Codecov Report

Merging #367 (e4ac24d) into main (c18025b) will increase coverage by 0.02%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   96.18%   96.20%   +0.02%     
==========================================
  Files          83       83              
  Lines        3461     3480      +19     
==========================================
+ Hits         3329     3348      +19     
  Misses        132      132              
Flag Coverage Δ
unittests 96.20% <91.66%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
doctr/datasets/ocr.py 91.89% <80.00%> (+0.22%) ⬆️
doctr/datasets/funsd.py 96.87% <83.33%> (+0.10%) ⬆️
doctr/datasets/cord.py 97.50% <85.71%> (+0.13%) ⬆️
doctr/datasets/sroie.py 94.87% <87.50%> (+0.27%) ⬆️
doctr/datasets/datasets/base.py 95.34% <100.00%> (+0.11%) ⬆️
doctr/datasets/datasets/pytorch.py 100.00% <100.00%> (ø)
doctr/datasets/datasets/tensorflow.py 100.00% <100.00%> (ø)
doctr/datasets/detection.py 96.96% <100.00%> (+0.09%) ⬆️
doctr/datasets/recognition.py 89.47% <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 c18025b...e4ac24d. 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 a73a9f3 into main Jul 7, 2021
@fg-mindee fg-mindee deleted the ds-fp16 branch July 7, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: references Related to references folder ext: tests Related to tests folder framework: pytorch Related to PyTorch backend framework: tensorflow Related to TensorFlow backend module: datasets Related to doctr.datasets type: breaking change Introducing a breaking change type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants