v0.7.0
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 toTrue
by default in #1279
=> To restore the old behaviour you can passpreserve_aspect_ratio=False
to thepredictor
instance
New features
- Feat: Make detection training and inference Multiclass by @aminemindee in #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.
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 #1097
New Features
- feat: ✨ PyTorch Recognition Model Multi-GPU support by @odulcy-mindee in #1164
- [Feat] Add PARSeq model TF and PT by @nikokks in #1205
- [Feat] Predictor precision PT backend by @felixdittrich92 in #1204
- feat: ✨ ClearML support for TensorFlow by @odulcy-mindee in #1257
Bug Fixes
- fix classification model cuda move by @odulcy-mindee in #1125
- fix: 🔧 docker api use GitHub repository by @odulcy-mindee in #1148
- Error in unpacking archive of SROIE dataset by @HamzaGbada in #1178
- [Fix] remove autogen version.py fix docs build and fix version identifier by @felixT2K in #1180
- [FIX] Error in unpacking archive of CORD dataset by @HamzaGbada in #1190
- chore(deps-dev): update docutils requirement from <0.20 to <0.21 by @dependabot in #1198
- speed up VIT models and fix patch size by @felixdittrich92 in #1219
- [Fix] PARSeq pytorch fixes by @felixdittrich92 in #1227
- [Fix] PARSeq tensorflow fixes by @felixdittrich92 in #1228
- [fix/chore] fix bug in tf det eval script / update dep version specifier by @felixdittrich92 in #1232
- fix: 🐛 fix bug when training object detection by @aminemindee in #1254
- [Fix] fix obj det train and suppress endless warning prints by @felixdittrich92 in #1267
- [Fix] add ignore keys if classes differ - KIE training by @felixdittrich92 in #1271
- change the way model is saved in ddp by @venkatapathy in #1289
Improvements
- Improve pypdfium2 integration again by @mara004 in #1096
- [build] replaces flake8 with ruff by @felixT2K in #1179
- [datasets] Add IIIT HWS dataset by @felixT2K in #1199
- feat: ✨ TF linknet_resnet18 checkpoint by @odulcy-mindee in #1231
- [tests/bug] improve tests and fix a minor bug by @felixdittrich92 in #1229
- [PyTorch] update transforms pytorch (classification / det / rec) by @felixdittrich92 in #1253
- [docs] custom model load by @felixdittrich92 in #1263
- feat: ✨ TF ViTSTR Small checkpoint by @odulcy-mindee in #1273
- [predictor] aspect ratio true by default by @felixdittrich92 in #1279
- feat: ✨ TF SAR Resnet31 checkpoint by @odulcy-mindee in #1281
Miscellaneous
- chore: apply post release modifications v0.6.0 by @felixdittrich92 in #1081
- chore: dev version downgrade from 0.7.0 to 0.6.1 by @felixdittrich92 in #1082
- chore(deps-dev): update black requirement from <23.0,>=22.1 to >=22.1,<24.0 by @dependabot in #1140
- chore(deps-dev): update docutils requirement from <0.18 to <0.20 by @dependabot in #1101
- docs: Minor typo fix by @khanfarhan10 in #1150
- Update utils.py by @weiwangmeta in #1177
- [tests/TF/build] enable missing classification onnx tests and set tensorflow lower bound to 2.11 by @felixT2K in #1182
- [build] update pytorch dependency by @felixT2K in #1188
- [build] drop py3.6/3.7 support and update CI default to py3.8/3.9 by @felixT2K in #1184
- [CI] change old cache action and skip TF classification onnx export temporarily by @felixT2K in #1201
- [Fix] add missing mean/std defaults, add missing weight init for sar by @felixT2K in #1212
- [classification] vit and magc_resnet checkpoints by @felixdittrich92 in #1221
- [tests] update test cases by @felixT2K in #1233
- chore: apply PIL major changes and increase min version specifier by @felixT2K in #1237
- [chore]: Pypdfium2 compatibility fix by @felixT2K in #1239
- [chore]: Replace
tensorflow_addons
by @felixdittrich92 in #1252 - [style] Fix markdown style warnings by @felixdittrich92 in #1260
- [docs] update export page to ONNX by @felixdittrich92 in #1261
- [PyPi] Fix image display by @felixdittrich92 in #1268
- [chore] increase version and update maintainers by @felixT2K in #1264
- [demo] update models list for Tf / PT backend by @felixdittrich92 in #1280
- [chore] update to new torchvision API in models as well by @felixT2K in #1291
- [chore]: clean dependencies by @felixT2K in #1287
- feat: ✨ TF Parseq checkpoint by @odulcy-mindee in #1305
- feat: ✨ TF ViTSTR Base checkpoint by @odulcy-mindee in #1306
- [docs] update benchmark page by @felixdittrich92 in #1234
New Contributors
- @dependabot made their first contribution in #1140
- @eltociear made their first contribution in #1119
- @khanfarhan10 made their first contribution in #1150
- @weiwangmeta made their first contribution in #1177
- @HamzaGbada made their first contribution in #1178
- @felixT2K made their first contribution in #1180
- @nikokks made their first contribution in #1205
- @odulcy made their first contribution in #1246
- @venkatapathy made their first contribution in #1289
Full Changelog: v0.6.0...v0.7.0