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
detectionmodel changed fromdb_resnet50tofast_base. NOTE: Can be reverted by passing the detection modelpredictor = ocr_predictor(det_arch="db_resnet50", pretrained=True) - The default value of
resolve_blockschanged fromTruetoFalseNOTE: Can be reverted by passingresolve_blocks=Trueto 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_scorein 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 or TensorFlow required - build on top of onnxruntime
- 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 https://github.com/mindee/doctr/pull/1588 - [misc] update README & fix mypy & change resolve blocks default by @felixT2K in https://github.com/mindee/doctr/pull/1686
New Features
- [prototype] object det replacement / init contrib modules by @felixdittrich92 in https://github.com/mindee/doctr/pull/1534
Bug Fixes
- [FIX] Fix mistake in FASTConvLayer and tf reparameterization by @felixdittrich92 in https://github.com/mindee/doctr/pull/1506
- [Fix] sar_resnet31 TF + PT by @felixdittrich92 in https://github.com/mindee/doctr/pull/1513
- [Fix] crop orientation KIE by @felixdittrich92 in https://github.com/mindee/doctr/pull/1548
- [Fix] allign orientation train script to current orientation model (counter clockwise instead of clockwise) & make OrientationPredictor dynamic by @felixdittrich92 in https://github.com/mindee/doctr/pull/1559
- [Fix / transforms] RandomHorizontalFlip & RandomCrop by @felixdittrich92 in https://github.com/mindee/doctr/pull/1572
- [FIX] parseq onnx export by @felixdittrich92 in https://github.com/mindee/doctr/pull/1585
- [Fix] close PIL images when loading images to tensor/numpy by @helpmefindaname in https://github.com/mindee/doctr/pull/1598
- [conda] Fix meta.yaml package function name by @felixdittrich92 in https://github.com/mindee/doctr/pull/1603
- [bug] remove TF multiprocessing workers by @felixdittrich92 in https://github.com/mindee/doctr/pull/1635
- [IO] Pdf File close after opening by @justinjosephmkj in https://github.com/mindee/doctr/pull/1624
- [bug] exclude scores if rot and eval straight by @felixdittrich92 in https://github.com/mindee/doctr/pull/1639
- Fixed assume_straight_pages for custom models by @Fabioomega in https://github.com/mindee/doctr/pull/1681
Improvements
- [docs] documentation for changing predictors batch sizes by @felixdittrich92 in https://github.com/mindee/doctr/pull/1514
- feat: :sparkles: torch fast_tiny checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1518
- [models] Add benchmark fast_tiny and reparameterize by default by @felixdittrich92 in https://github.com/mindee/doctr/pull/1519
- feat: :sparkles: PT fast base checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1526
- feat: :sparkles: PT fast small checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1529
- [API] update api for multi file and pdf support by @felixdittrich92 in https://github.com/mindee/doctr/pull/1522
- [feature] Add word crop general orientation to output by @felixdittrich92 in https://github.com/mindee/doctr/pull/1546
- feat: :sparkles: torch
mobilenet_v3_small_orientationchkpt by @odulcy-mindee in https://github.com/mindee/doctr/pull/1557 - [metrics] speed up polygon iou (for --rotation) by keeping balanced memory footprint by @felixdittrich92 in https://github.com/mindee/doctr/pull/1561
- [orientation] augment angle while training by @felixdittrich92 in https://github.com/mindee/doctr/pull/1567
- [orientation] Part 1: Add page orientation predictor by @felixdittrich92 in https://github.com/mindee/doctr/pull/1566
- feat: :sparkles: torch mobilenet_v3_small_crop_orientation by @odulcy-mindee in https://github.com/mindee/doctr/pull/1571
- feat: :sparkles: improve mobilenet_v3_page_orientation checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1573
- [transforms] Add RandomResize (like ZoomOut) by @felixdittrich92 in https://github.com/mindee/doctr/pull/1574
- [references] Update detection augmentations by @felixdittrich92 in https://github.com/mindee/doctr/pull/1577
- [TF] add fast models and benchmarks by @felixdittrich92 in https://github.com/mindee/doctr/pull/1583
- [transforms] small random resize improvement by @felixdittrich92 in https://github.com/mindee/doctr/pull/1584
- [docs] Add onnx inference doc by @felixdittrich92 in https://github.com/mindee/doctr/pull/1601
- feat: :sparkles: torch db_mobilenet_v3_large checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1632
- [detection] move padding removal directly to detection by @felixdittrich92 in https://github.com/mindee/doctr/pull/1627
- feat: ✨ tf mobilenet_v3_small_page_orientation checkpoint by @odulcy-mindee in https://github.com/mindee/doctr/pull/1636
- [builder] Add objectness scores by @felixdittrich92 in https://github.com/mindee/doctr/pull/1625
- [orientation] page orientation improvements by @felixdittrich92 in https://github.com/mindee/doctr/pull/1553
- [Datasets] Add hindi & bangla vocabs by @felixT2K in https://github.com/mindee/doctr/pull/1687
Miscellaneous
- [misc] apply 0.8.1 post release modifications by @felixdittrich92 in https://github.com/mindee/doctr/pull/1498
- Replace unidecode with text-unidecode. by @jonatankawalek in https://github.com/mindee/doctr/pull/1509
- [misc] update dev deps by @felixdittrich92 in https://github.com/mindee/doctr/pull/1510
- [benchmark] fast base pytorch by @felixdittrich92 in https://github.com/mindee/doctr/pull/1523
- [benchmark] fast small benchmark by @felixdittrich92 in https://github.com/mindee/doctr/pull/1527
- [Misc] drop py 3.8 support by @felixdittrich92 in https://github.com/mindee/doctr/pull/1457
- [CI] update CI actions by @felixdittrich92 in https://github.com/mindee/doctr/pull/1558
- Exclude deps & split into optional parts by @felixdittrich92 in https://github.com/mindee/doctr/pull/1551
- [references] remove missed parts of old obj det by @felixdittrich92 in https://github.com/mindee/doctr/pull/1568
- [tests/onnx] Add onnx and model out check by @felixdittrich92 in https://github.com/mindee/doctr/pull/1569
- [Fix] Pin py3.11 for MacOS latest / update publish version checks by @felixdittrich92 in https://github.com/mindee/doctr/pull/1503
- [build] Finally to py 3.9 by @felixdittrich92 in https://github.com/mindee/doctr/pull/1647
New Contributors
- @jonatankawalek made their first contribution in https://github.com/mindee/doctr/pull/1509
- @helpmefindaname made their first contribution in https://github.com/mindee/doctr/pull/1598
- @justinjosephmkj made their first contribution in https://github.com/mindee/doctr/pull/1624
- @Fabioomega made their first contribution in https://github.com/mindee/doctr/pull/1681
Full Changelog: https://github.com/mindee/doctr/compare/v0.8.1...v0.9.0