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

[metrics] speed up polygon iou (for --rotation) by keeping balanced memory footprint #1561

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

felixdittrich92
Copy link
Contributor

@felixdittrich92 felixdittrich92 commented Apr 22, 2024

This PR:

  • boost polygon iou (from hours to a few minutes) and try to keep an balanced memory consumption
  • remove now unused functions in metrics.py
  • remove unused use_broadcasting / mask_shape and psutil requirements for references
  • memory usage tested with oversampled funsd validation dataset (~4K samples) tooks around 6.5 GB RAM

Any feedback is welcome 🤗

Closes: #1472

@felixdittrich92 felixdittrich92 added type: enhancement Improvement module: utils Related to doctr.utils ext: references Related to references folder topic: text detection Related to the task of text detection labels Apr 22, 2024
@felixdittrich92 felixdittrich92 added this to the 0.9.0 milestone Apr 22, 2024
@felixdittrich92 felixdittrich92 self-assigned this Apr 22, 2024
@felixdittrich92
Copy link
Contributor Author

failing tests: hf hub is down :D

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 11.76471% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 57.76%. Comparing base (f21ac32) to head (469e620).

❗ Current head 469e620 differs from pull request most recent head cc81298. Consider uploading reports for the commit cc81298 to get more accurate results

Files Patch % Lines
doctr/utils/metrics.py 11.76% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1561      +/-   ##
==========================================
+ Coverage   57.70%   57.76%   +0.05%     
==========================================
  Files         167      166       -1     
  Lines        7696     7624      -72     
==========================================
- Hits         4441     4404      -37     
+ Misses       3255     3220      -35     
Flag Coverage Δ
unittests 57.76% <11.76%> (+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.

doctr/utils/metrics.py Show resolved Hide resolved
doctr/utils/metrics.py Show resolved Hide resolved
@odulcy-mindee odulcy-mindee merged commit c957cf8 into mindee:main Apr 25, 2024
79 of 80 checks passed
@felixdittrich92 felixdittrich92 deleted the update-metric branch August 30, 2024 11:31
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 module: utils Related to doctr.utils topic: text detection Related to the task of text detection type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[metrics] Computing metrics with --rotation takes to much memory and process time
2 participants