Skip to content

[models] Switch torch.load to weights_only loading / copy boxes in - #2176

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
felixdittrich92:minor
Oct 19, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
felixdittrich92:minor

Conversation

@felixdittrich92

@felixdittrich92 felixdittrich92 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

This PR:

  • Switch to secure torch.load with weights_only=True
  • Copy boxes in crop_boxes to avoid inplce modification issues

@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 19, 2026
@felixdittrich92 felixdittrich92 self-assigned this Oct 19, 2026
@felixdittrich92 felixdittrich92 added module: models Related to doctr.models module: transforms Related to doctr.transforms framework: pytorch Related to PyTorch backend type: misc Miscellaneous labels Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.61%. Comparing base (4e29d3f) to head (4f664e7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2176      +/-   ##
==========================================
- Coverage   97.62%   97.61%   -0.01%     
==========================================
  Files         170      170              
  Lines       10740    10741       +1     
==========================================
  Hits        10485    10485              
- Misses        255      256       +1     
Flag Coverage Δ
unittests 97.61% <100.00%> (-0.01%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@felixdittrich92
felixdittrich92 marked this pull request as ready for review October 19, 2026 09:13
@felixdittrich92
felixdittrich92 merged commit 687503d into mindee:main Oct 19, 2026
56 of 57 checks passed
@felixdittrich92
felixdittrich92 deleted the minor branch October 19, 2026 09:15
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 module: models Related to doctr.models module: transforms Related to doctr.transforms type: misc Miscellaneous

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsafe torch.load deserialization in load_pretrained_params() allows remote code execution

1 participant