Note: docTR 0.11.0 requires python >= 3.10
Note: docTR 0.11.0 requires either TensorFlow >= 2.15.0 or PyTorch >= 2.0.0
What's changed
New features
- Added
torch.compile
support (PyTorch backend) - Improved model training logging
- Created a small labeling tool designed for docTR (early stage) --> doctr-labeler
Compile your model
Compiling your PyTorch models with torch.compile
optimizes the model by converting it to a graph representation and applying backends that can improve performance.
This process can make inference faster and reduce memory overhead during execution.
Further information can be found in the PyTorch documentation
import torch
from doctr.models import (
ocr_predictor,
vitstr_small,
fast_base,
mobilenet_v3_small_crop_orientation,
mobilenet_v3_small_page_orientation,
crop_orientation_predictor,
page_orientation_predictor
)
# Compile the models
detection_model = torch.compile(
fast_base(pretrained=True).eval()
)
recognition_model = torch.compile(
vitstr_small(pretrained=True).eval()
)
crop_orientation_model = torch.compile(
mobilenet_v3_small_crop_orientation(pretrained=True).eval()
)
page_orientation_model = torch.compile(
mobilenet_v3_small_page_orientation(pretrained=True).eval()
)
predictor = models.ocr_predictor(
detection_model, recognition_model, assume_straight_pages=False
)
# NOTE: Only required for non-straight pages (`assume_straight_pages=False`) and non-disabled orientation classification
# Set the orientation predictors
predictor.crop_orientation_predictor = crop_orientation_predictor(crop_orientation_model)
predictor.page_orientation_predictor = page_orientation_predictor(page_orientation_model)
compiled_out = predictor(doc)
What's Changed
New Features
- [Feat] Add torch.compile support by @felixdittrich92 in #1791
- feat: ✨ tqdm slack by @odulcy-mindee in #1837
- [docs] Add note about labeling tool to training section by @felixdittrich92 in #1839
- feat: ✨ ClearML training loss logging by @odulcy-mindee in #1844
Bug Fixes
- [Fix] documentation deploy CI/CD job by @felixdittrich92 in #1781
- [CI] Fix PR labeler job & Rollback doc deploy deps by @felixdittrich92 in #1786
- [build] Fix tensorflow build dep by @felixdittrich92 in #1807
- fix: 🐛 sanitize docker tag step by @odulcy-mindee in #1809
- [Bug] Fix vocabs and add corresponding test case by @felixdittrich92 in #1813
- [Bug] Replace mem leaking torch gaussian_blur in augmentations by @felixdittrich92 in #1822
- [Fix] Fix tqdm slack message write : monkeypatch by @felixdittrich92 in #1852
- [Fix] Fix loading targets in WILDRECEIPT init by @Razlaw in #1859
Improvements
- [TF] Change eager mode by @felixdittrich92 in #1763
- [models] Change Resize kwargs to args for each zoo predictor by @cmoscardi in #1765
- [Docs] Add community docs by @felixdittrich92 in #1766
- [CI/CD] update Dependabot by @felixdittrich92 in #1768
- adding pytorch DDP script of detection task by @sarjil77 in #1777
- docs: fix faulty code for prediction and recognition demos by @khanfarhan10 in #1800
- feat: ✨ specify
output_dir
in reference scripts by @odulcy-mindee in #1820 - [references] Unify sched + optim config and add AdamW as option by @felixdittrich92 in #1825
- [misc] Update header year & clearer built-in datasets progress bar msg by @felixdittrich92 in #1831
- Adding Gujarati Language support by @sarjil77 in #1845
- [references] Update Logging by @felixdittrich92 in #1847
Miscellaneous
- [misc] post release modifications v0.10.0 by @felixdittrich92 in #1756
- Introducing docTR Guru on Gurubase.io by @kursataktas in #1760
- [tests/style] Fix tf test and formatting by @felixdittrich92 in #1762
- [build] Upgrade py 3.10 by @felixdittrich92 in #1770
- [misc] Change prefered backend from tf to torch by @felixdittrich92 in #1779
- bump: ⬆️ CUDA Version by @odulcy-mindee in #1769
- [CI/code quality] Add clear github runner caches job + mypy fixes by @felixdittrich92 in #1783
- ci(dependabot): remove frgfm from automatic reviewers by @frgfm in #1787
- [CI] public docker job - change commit tag to version by @felixdittrich92 in #1789
- [misc] Small DDP script adjustments by @felixT2K in #1793
- [misc] Replace in deprecation dropped httpx.AsyncClient app arg by @felixT2K in #1802
- [docs] Tiny documentation export page fix by @felixdittrich92 in #1824
- [CI/CD] Replace deprecated parts conda & publish by @felixdittrich92 in #1842
- [misc] Increase minor version to v0.11.0 by @felixdittrich92 in #1858
New Contributors
- @agarkovv made their first contribution in #1758
- @kursataktas made their first contribution in #1760
- @cmoscardi made their first contribution in #1765
- @sarjil77 made their first contribution in #1777
- @Razlaw made their first contribution in #1859
Full Changelog: v0.10.0...v0.11.0