v0.9.0
Note: docTR 0.9.0 requires python >= 3.9
Note: docTR 0.9.0 requires either TensorFlow >= 2.11.0 or PyTorch >= 1.12.0.
What's Changed
Soft Breaking Changes 🛠
- The default
detection
model changed fromdb_resnet50
tofast_base
.
NOTE: Can be reverted by passing the detection modelpredictor = ocr_predictor(det_arch="db_resnet50", pretrained=True)
- The default value of
resolve_blocks
changed fromTrue
toFalse
NOTE: Can be reverted by passingresolve_blocks=True
to theocr_predictor
New features
- Fast models got pretrained checkpoints by @odulcy-mindee @felixdittrich92
- Introducing a contributions module which replaces the obj detection and builds a place for more pipelines by @felixdittrich92
- Improved orientation detection by @felixdittrich92 @odulcy-mindee
- Improved and updated API template by @felixdittrich92
- Include
objectness_score
in results by @felixdittrich92 - Add word crop general orientation to output by @felixdittrich92
- Split library into parts (optional dependencies) by @felixdittrich92
- Add page orientation predictor by @felixdittrich92 @odulcy-mindee
- Add onnx inference doc by @felixdittrich92
✨ Installation ✨
We have splitted docTR into some optional parts to make it a bit more lightweight and to exclude parts which are not required for inference.
Optional parts are:
- visualization (to support
.show()
) - html support (to support
.from_url(...)
) - contribution module
# for TensorFlow without any optional dependencies
pip install "python-doctr[tf]"
# for PyTorch without any optional dependencies
pip install "python-doctr[torch]"
# Installs pytorch and all available optional parts
pip install "python-doctr[torch,viz,html,contib]"
✨ ONNX and OnnxTR ✨
We have build a standalone library to provide a super lightweight way to use existing docTR onnx exported models or your custom onces.
benefits:
- kown docTR interface (
ocr_predictor
, etc.) - no
PyTorch
orTensorFlow
required - build on top ofonnxruntime
- more lightweight package with faster inference latency and less required resources
- 8-Bit quantized models for faster inference on CPU
Give it a try and check it out: OnnxTR
docTR docs: ONNX / OnnxTR
What's Changed
Breaking Changes 🛠
- [models] Change default model to
fast_base
- soft breaking change by @felixdittrich92 in #1588 - [misc] update README & fix mypy & change resolve blocks default by @felixT2K in #1686
New Features
- [prototype] object det replacement / init contrib modules by @felixdittrich92 in #1534
Bug Fixes
- [FIX] Fix mistake in FASTConvLayer and tf reparameterization by @felixdittrich92 in #1506
- [Fix] sar_resnet31 TF + PT by @felixdittrich92 in #1513
- [Fix] crop orientation KIE by @felixdittrich92 in #1548
- [Fix] allign orientation train script to current orientation model (counter clockwise instead of clockwise) & make OrientationPredictor dynamic by @felixdittrich92 in #1559
- [Fix / transforms] RandomHorizontalFlip & RandomCrop by @felixdittrich92 in #1572
- [FIX] parseq onnx export by @felixdittrich92 in #1585
- [Fix] close PIL images when loading images to tensor/numpy by @helpmefindaname in #1598
- [conda] Fix meta.yaml package function name by @felixdittrich92 in #1603
- [bug] remove TF multiprocessing workers by @felixdittrich92 in #1635
- [IO] Pdf File close after opening by @justinjosephmkj in #1624
- [bug] exclude scores if rot and eval straight by @felixdittrich92 in #1639
- Fixed assume_straight_pages for custom models by @Fabioomega in #1681
Improvements
- [docs] documentation for changing predictors batch sizes by @felixdittrich92 in #1514
- feat: ✨ torch fast_tiny checkpoint by @odulcy-mindee in #1518
- [models] Add benchmark fast_tiny and reparameterize by default by @felixdittrich92 in #1519
- feat: ✨ PT fast base checkpoint by @odulcy-mindee in #1526
- feat: ✨ PT fast small checkpoint by @odulcy-mindee in #1529
- [API] update api for multi file and pdf support by @felixdittrich92 in #1522
- [feature] Add word crop general orientation to output by @felixdittrich92 in #1546
- feat: ✨ torch
mobilenet_v3_small_orientation
chkpt by @odulcy-mindee in #1557 - [metrics] speed up polygon iou (for --rotation) by keeping balanced memory footprint by @felixdittrich92 in #1561
- [orientation] augment angle while training by @felixdittrich92 in #1567
- [orientation] Part 1: Add page orientation predictor by @felixdittrich92 in #1566
- feat: ✨ torch mobilenet_v3_small_crop_orientation by @odulcy-mindee in #1571
- feat: ✨ improve mobilenet_v3_page_orientation checkpoint by @odulcy-mindee in #1573
- [transforms] Add RandomResize (like ZoomOut) by @felixdittrich92 in #1574
- [references] Update detection augmentations by @felixdittrich92 in #1577
- [TF] add fast models and benchmarks by @felixdittrich92 in #1583
- [transforms] small random resize improvement by @felixdittrich92 in #1584
- [docs] Add onnx inference doc by @felixdittrich92 in #1601
- feat: ✨ torch db_mobilenet_v3_large checkpoint by @odulcy-mindee in #1632
- [detection] move padding removal directly to detection by @felixdittrich92 in #1627
- feat: ✨ tf mobilenet_v3_small_page_orientation checkpoint by @odulcy-mindee in #1636
- [builder] Add objectness scores by @felixdittrich92 in #1625
- [orientation] page orientation improvements by @felixdittrich92 in #1553
- [Datasets] Add hindi & bangla vocabs by @felixT2K in #1687
Miscellaneous
- [misc] apply 0.8.1 post release modifications by @felixdittrich92 in #1498
- Replace unidecode with text-unidecode. by @jonatankawalek in #1509
- [misc] update dev deps by @felixdittrich92 in #1510
- [benchmark] fast base pytorch by @felixdittrich92 in #1523
- [benchmark] fast small benchmark by @felixdittrich92 in #1527
- [Misc] drop py 3.8 support by @felixdittrich92 in #1457
- [CI] update CI actions by @felixdittrich92 in #1558
- Exclude deps & split into optional parts by @felixdittrich92 in #1551
- [references] remove missed parts of old obj det by @felixdittrich92 in #1568
- [tests/onnx] Add onnx and model out check by @felixdittrich92 in #1569
- [Fix] Pin py3.11 for MacOS latest / update publish version checks by @felixdittrich92 in #1503
- [build] Finally to py 3.9 by @felixdittrich92 in #1647
New Contributors
- @jonatankawalek made their first contribution in #1509
- @helpmefindaname made their first contribution in #1598
- @justinjosephmkj made their first contribution in #1624
- @Fabioomega made their first contribution in #1681
Full Changelog: v0.8.1...v0.9.0