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] Resize interpolation difference CV2 and Pillow to come closer with docTR #22

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

felixdittrich92
Copy link
Owner

This PR:

  • move to Pillow for resizing to overcome the interpolation mismatch between CV2 and Pillow

@felixdittrich92 felixdittrich92 self-assigned this Jul 8, 2024
@felixdittrich92 felixdittrich92 changed the title [Fix] [Fix] Resize interpolation difference CV2 and Pillow to come closer with docTR Jul 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.86%. Comparing base (03a1277) to head (0f05709).

Files Patch % Lines
onnxtr/transforms/base.py 96.42% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   97.81%   97.86%   +0.05%     
==========================================
  Files          63       63              
  Lines        1920     1920              
==========================================
+ Hits         1878     1879       +1     
+ Misses         42       41       -1     
Flag Coverage Δ
unittests 97.86% <97.05%> (+0.05%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@felixdittrich92
Copy link
Owner Author

Overview:

Before:

(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_resnet34
Mean difference between DOCTR and ONNXTR prob maps: 0.00266014
(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_resnet50
Mean difference between DOCTR and ONNXTR prob maps: 0.00546016
(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_mobilenet_v3_large
Mean difference between DOCTR and ONNXTR prob maps: 0.00505121
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet18
Mean difference between DOCTR and ONNXTR prob maps: 0.00332537
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet34
Mean difference between DOCTR and ONNXTR prob maps: 0.00293290
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet50
Mean difference between DOCTR and ONNXTR prob maps: 0.00237311
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_tiny
Mean difference between DOCTR and ONNXTR prob maps: 0.07307008
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_small
Mean difference between DOCTR and ONNXTR prob maps: 0.07393986
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_base
Mean difference between DOCTR and ONNXTR prob maps: 0.07267220

After:

(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_resnet34
Mean difference between DOCTR and ONNXTR prob maps: 0.00000007
(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_resnet50
Mean difference between DOCTR and ONNXTR prob maps: 0.00005615
(1024, 1024, 1)
(1024, 1024, 1)
Det model: db_mobilenet_v3_large
Mean difference between DOCTR and ONNXTR prob maps: 0.00003883
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet18
Mean difference between DOCTR and ONNXTR prob maps: 0.00000575
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet34
Mean difference between DOCTR and ONNXTR prob maps: 0.00002059
(1024, 1024, 1)
(1024, 1024, 1)
Det model: linknet_resnet50
Mean difference between DOCTR and ONNXTR prob maps: 0.00000474
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_tiny
Mean difference between DOCTR and ONNXTR prob maps: 0.07032311
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_small
Mean difference between DOCTR and ONNXTR prob maps: 0.07004898
(1024, 1024, 1)
(1024, 1024, 1)
Det model: fast_base
Mean difference between DOCTR and ONNXTR prob maps: 0.07088637

@felixdittrich92 felixdittrich92 linked an issue Jul 8, 2024 that may be closed by this pull request
@felixdittrich92 felixdittrich92 merged commit a2b1e9b into main Jul 8, 2024
14 checks passed
@felixdittrich92 felixdittrich92 deleted the fix-resize branch July 8, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Different results between doctr and onnxtr models.
2 participants