<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>
Note: doctr 0.7.0 requires either TensorFlow >= 2.11.0 or PyTorch >= 1.12.0.
Note: We will release the missing PyTorch checkpoints with 0.7.1
What's Changed
Breaking Changes ðŸ›
* We changed the `preserve_aspect_ratio` parameter to `True` by default in https://github.com/mindee/doctr/pull/1279
=> To restore the old behaviour you can pass `preserve_aspect_ratio=False` to the `predictor` instance
New features
* Feat: Make detection training and inference Multiclass by aminemindee in https://github.com/mindee/doctr/pull/1097
* Now all TensorFlow models have pretrained weights by odulcy-mindee
* The docs was updated and model corresponding benchmarks was added by felixdittrich92
* Two new recognition models was added (ViTSTR and PARSeq) in both frameworks by felixdittrich92 nikokks
Add of the KIE predictor
The KIE predictor is a more flexible predictor compared to OCR as your detection model can detect multiple classes in a document. For example, you can have a detection model to detect just dates and adresses in a document.
The KIE predictor makes it possible to use detector with multiple classes with a recognition model and to have the whole pipeline already setup for you.
python
from doctr.io import DocumentFile
from doctr.models import kie_predictor
Model
model = kie_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True)
PDF
doc = DocumentFile.from_pdf("path/to/your/doc.pdf")
Analyze
result = model(doc)
predictions = result.pages[0].predictions
for class_name in predictions.keys():
list_predictions = predictions[class_name]
for prediction in list_predictions:
print(f"Prediction for {class_name}: {prediction}")
The KIE predictor results per page are in a dictionary format with each key representing a class name and it's value are the predictions for that class.
What's Changed
Breaking Changes ðŸ›
* Feat: Make detection training and inference Multiclass by aminemindee in https://github.com/mindee/doctr/pull/1097
New Features
* feat: :sparkles: PyTorch Recognition Model Multi-GPU support by odulcy-mindee in https://github.com/mindee/doctr/pull/1164
* [Feat] Add PARSeq model TF and PT by nikokks in https://github.com/mindee/doctr/pull/1205
* [Feat] Predictor precision PT backend by felixdittrich92 in https://github.com/mindee/doctr/pull/1204
* feat: :sparkles: ClearML support for TensorFlow by odulcy-mindee in https://github.com/mindee/doctr/pull/1257
Bug Fixes
* fix classification model cuda move by odulcy-mindee in https://github.com/mindee/doctr/pull/1125
* fix: :wrench: docker api use GitHub repository by odulcy-mindee in https://github.com/mindee/doctr/pull/1148
* Error in unpacking archive of SROIE dataset by HamzaGbada in https://github.com/mindee/doctr/pull/1178
* [Fix] remove autogen version.py fix docs build and fix version identifier by felixT2K in https://github.com/mindee/doctr/pull/1180
* [FIX] Error in unpacking archive of CORD dataset by HamzaGbada in https://github.com/mindee/doctr/pull/1190
* chore(deps-dev): update docutils requirement from <0.20 to <0.21 by dependabot in https://github.com/mindee/doctr/pull/1198
* speed up VIT models and fix patch size by felixdittrich92 in https://github.com/mindee/doctr/pull/1219
* [Fix] PARSeq pytorch fixes by felixdittrich92 in https://github.com/mindee/doctr/pull/1227
* [Fix] PARSeq tensorflow fixes by felixdittrich92 in https://github.com/mindee/doctr/pull/1228
* [fix/chore] fix bug in tf det eval script / update dep version specifier by felixdittrich92 in https://github.com/mindee/doctr/pull/1232
* fix: :bug: fix bug when training object detection by aminemindee in https://github.com/mindee/doctr/pull/1254
* [Fix] fix obj det train and suppress endless warning prints by felixdittrich92 in https://github.com/mindee/doctr/pull/1267
* [Fix] add ignore keys if classes differ - KIE training by felixdittrich92 in https://github.com/mindee/doctr/pull/1271
* change the way model is saved in ddp by venkatapathy in https://github.com/mindee/doctr/pull/1289
Improvements
* Improve pypdfium2 integration again by mara004 in https://github.com/mindee/doctr/pull/1096
* [build] replaces flake8 with ruff by felixT2K in https://github.com/mindee/doctr/pull/1179
* [datasets] Add IIIT HWS dataset by felixT2K in https://github.com/mindee/doctr/pull/1199
* feat: :sparkles: TF linknet_resnet18 checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1231
* [tests/bug] improve tests and fix a minor bug by felixdittrich92 in https://github.com/mindee/doctr/pull/1229
* [PyTorch] update transforms pytorch (classification / det / rec) by felixdittrich92 in https://github.com/mindee/doctr/pull/1253
* [docs] custom model load by felixdittrich92 in https://github.com/mindee/doctr/pull/1263
* feat: :sparkles: TF ViTSTR Small checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1273
* [predictor] aspect ratio true by default by felixdittrich92 in https://github.com/mindee/doctr/pull/1279
* feat: :sparkles: TF SAR Resnet31 checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1281
Miscellaneous
* chore: apply post release modifications v0.6.0 by felixdittrich92 in https://github.com/mindee/doctr/pull/1081
* chore: dev version downgrade from 0.7.0 to 0.6.1 by felixdittrich92 in https://github.com/mindee/doctr/pull/1082
* chore(deps-dev): update black requirement from <23.0,>=22.1 to >=22.1,<24.0 by dependabot in https://github.com/mindee/doctr/pull/1140
* chore(deps-dev): update docutils requirement from <0.18 to <0.20 by dependabot in https://github.com/mindee/doctr/pull/1101
* docs: Minor typo fix by khanfarhan10 in https://github.com/mindee/doctr/pull/1150
* Update utils.py by weiwangmeta in https://github.com/mindee/doctr/pull/1177
* [tests/TF/build] enable missing classification onnx tests and set tensorflow lower bound to 2.11 by felixT2K in https://github.com/mindee/doctr/pull/1182
* [build] update pytorch dependency by felixT2K in https://github.com/mindee/doctr/pull/1188
* [build] drop py3.6/3.7 support and update CI default to py3.8/3.9 by felixT2K in https://github.com/mindee/doctr/pull/1184
* [CI] change old cache action and skip TF classification onnx export temporarily by felixT2K in https://github.com/mindee/doctr/pull/1201
* [Fix] add missing mean/std defaults, add missing weight init for sar by felixT2K in https://github.com/mindee/doctr/pull/1212
* [classification] vit and magc_resnet checkpoints by felixdittrich92 in https://github.com/mindee/doctr/pull/1221
* [tests] update test cases by felixT2K in https://github.com/mindee/doctr/pull/1233
* chore: apply PIL major changes and increase min version specifier by felixT2K in https://github.com/mindee/doctr/pull/1237
* [chore]: Pypdfium2 compatibility fix by felixT2K in https://github.com/mindee/doctr/pull/1239
* [chore]: Replace `tensorflow_addons` by felixdittrich92 in https://github.com/mindee/doctr/pull/1252
* [style] Fix markdown style warnings by felixdittrich92 in https://github.com/mindee/doctr/pull/1260
* [docs] update export page to ONNX by felixdittrich92 in https://github.com/mindee/doctr/pull/1261
* [PyPi] Fix image display by felixdittrich92 in https://github.com/mindee/doctr/pull/1268
* [chore] increase version and update maintainers by felixT2K in https://github.com/mindee/doctr/pull/1264
* [demo] update models list for Tf / PT backend by felixdittrich92 in https://github.com/mindee/doctr/pull/1280
* [chore] update to new torchvision API in models as well by felixT2K in https://github.com/mindee/doctr/pull/1291
* [chore]: clean dependencies by felixT2K in https://github.com/mindee/doctr/pull/1287
* feat: :sparkles: TF Parseq checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1305
* feat: :sparkles: TF ViTSTR Base checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1306
* [docs] update benchmark page by felixdittrich92 in https://github.com/mindee/doctr/pull/1234
New Contributors
* dependabot made their first contribution in https://github.com/mindee/doctr/pull/1140
* eltociear made their first contribution in https://github.com/mindee/doctr/pull/1119
* khanfarhan10 made their first contribution in https://github.com/mindee/doctr/pull/1150
* weiwangmeta made their first contribution in https://github.com/mindee/doctr/pull/1177
* HamzaGbada made their first contribution in https://github.com/mindee/doctr/pull/1178
* felixT2K made their first contribution in https://github.com/mindee/doctr/pull/1180
* nikokks made their first contribution in https://github.com/mindee/doctr/pull/1205
* odulcy made their first contribution in https://github.com/mindee/doctr/pull/1246
* venkatapathy made their first contribution in https://github.com/mindee/doctr/pull/1289
**Full Changelog**: https://github.com/mindee/doctr/compare/v0.6.0...v0.7.0