Python-doctr

Latest version: v0.10.0

Safety actively analyzes 681857 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.10.0

<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>

Note: docTR 0.10.0 requires python >= 3.9

0.9.0

<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>

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 from `db_resnet50` to `fast_base`.
**NOTE**: Can be reverted by passing the detection model `predictor = ocr_predictor(det_arch="db_resnet50", pretrained=True)`
* The default value of `resolve_blocks` changed from `True` to `False`
**NOTE**: Can be reverted by passing `resolve_blocks=True` to the `ocr_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` 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](https://github.com/felixdittrich92/OnnxTR)
docTR docs: [ONNX / OnnxTR](https://mindee.github.io/doctr/using_doctr/using_model_export.html#using-your-onnx-exported-model)

![Screenshot from 2024-08-09 09-15-37](https://github.com/user-attachments/assets/60775627-9ba1-47f2-bea8-4ed92cbf58fe)


<!-- Release notes generated using configuration in .github/release.yml at main -->

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_orientation` chkpt 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

0.8.1

<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>

Note: doctr 0.8.1 requires either TensorFlow >= 2.11.0 or PyTorch >= 1.12.0.

What's Changed

- Fixed conda receipt and CI jobs for conda and pypi releases
- Fixed some broken links

- Pre-Release: FAST text detection model from [FAST: Faster Arbitrarily-Shaped Text Detector with Minimalist Kernel Representation](https://arxiv.org/pdf/2111.02394) **-> Checkpoints will be provided with the next release**

0.8.0

<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>

Note: doctr 0.8.0 requires either TensorFlow >= 2.11.0 or PyTorch >= 1.12.0.

What's Changed
Breaking Changes 🛠
* `db_resnet50_rotation` (PyTorch) and `linknet_resnet18_rotation` (TensorFlow) are removed (All models can handle rotated documents now)
* `.show(doc)` changed to `.show()`

New features
* All models have pretrained checkpoints now by odulcy-mindee
* All detection models was retrained on rotated samples by odulcy-mindee
* Improved orientation detection for documents rotated between -90 and 90 degrees by felixdittrich92
* Conda deployment job & receipt added by frgfm
* Official docTR docker images are added by odulcy-mindee => [docker-images](https://github.com/mindee/doctr/pkgs/container/doctr)
* New benchmarks and documentation improvements by felixdittrich92
* `WildReceipt` dataset added by HamzaGbada
* EarlyStopping callback added to all training scripts by SkaarFacee
* Hook mechanism added to `ocr_predictor` to maniplulate the detection predictions in the middle of the pipeline to your needs by felixdittrich92

python

from doctr.model import ocr_predictor

class CustomHook:
def __call__(self, loc_preds):
Manipulate the location predictions here
1. The outpout structure needs to be the same as the input location predictions
2. Be aware that the coordinates are relative and needs to be between 0 and 1
return loc_preds

my_hook = CustomHook()

predictor = ocr_predictor(pretrained=True)
Add a hook in the middle of the pipeline
predictor.add_hook(my_hook)
You can also add multiple hooks which will be executed sequentially
for hook in [my_hook, my_hook, my_hook]:
predictor.add_hook(hook)


What's Changed
Breaking Changes 🛠
* [prototype] compute orientation on segmentation map by felixdittrich92 in https://github.com/mindee/doctr/pull/1336
New Features
* feat: :sparkles: Official docker images for docTR by odulcy-mindee in https://github.com/mindee/doctr/pull/1322
* Add wildreceipt dataset by HamzaGbada in https://github.com/mindee/doctr/pull/1359
* Added early stopping feature by SkaarFacee in https://github.com/mindee/doctr/pull/1397
* [PT / TF] Add TextNet - FAST backbone by felixdittrich92 in https://github.com/mindee/doctr/pull/1425
* feat: Adds conda recipe & corresponding CI jobs by frgfm in https://github.com/mindee/doctr/pull/1414
* [prototype] Extend detection result customization by felixdittrich92 in https://github.com/mindee/doctr/pull/1449
Bug Fixes
* [FIX] antialising in PreProcessor by felixdittrich92 in https://github.com/mindee/doctr/pull/1324
* [Fix] prob computation for parseq and vitstr models by felixdittrich92 in https://github.com/mindee/doctr/pull/1327
* [FIX] clip overflowing probs by felixdittrich92 in https://github.com/mindee/doctr/pull/1335
* [Fix] PT - convert BF16 tensor to float before calling .numpy() by chunyuan-w in https://github.com/mindee/doctr/pull/1342
* [Fix] Prob comp in vitstr and parseq for empty words by felixT2K in https://github.com/mindee/doctr/pull/1345
* [Fix] TF - add bf16 numpy dtype conversion by felixT2K in https://github.com/mindee/doctr/pull/1346
* [Fix] fix growing mem usage pytorch crnn by felixdittrich92 in https://github.com/mindee/doctr/pull/1357
* [Fix] tf augmentations by felixT2K in https://github.com/mindee/doctr/pull/1360
* Fix broken weasyprint link by simonw in https://github.com/mindee/doctr/pull/1367
* feat: :sparkles: use `tqdm` instead of `fastprogress` in reference scripts by odulcy-mindee in https://github.com/mindee/doctr/pull/1389
* [FIX] Fix mypy errors by felixdittrich92 in https://github.com/mindee/doctr/pull/1419
* [FIX] db loss TF and PT also for training with rotated samples by felixdittrich92 in https://github.com/mindee/doctr/pull/1396
* [FIX] Dice loss computation in both backends by felixdittrich92 in https://github.com/mindee/doctr/pull/1442
* [FIX] Fix streamlit demo by felixdittrich92 in https://github.com/mindee/doctr/pull/1447
* [Fix / Misc] Fix conda CI build and publish job and update actions by felixdittrich92 in https://github.com/mindee/doctr/pull/1453
* [Fix] Catch Divide by zero explicit by felixdittrich92 in https://github.com/mindee/doctr/pull/1471
Improvements
* feat: :sparkles: PT ViTSTR Small Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1319
* feat: :sparkles: PT Parseq Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1320
* [scripts] Add backbone freeze for recognition scripts and update augmentations also for DDP script by felixdittrich92 in https://github.com/mindee/doctr/pull/1328
* [PyTorch] replace no_grad with inference_mode by felixdittrich92 in https://github.com/mindee/doctr/pull/1323
* [transforms] update random apply to work also with targets by felixdittrich92 in https://github.com/mindee/doctr/pull/1333
* [TF] unify detection augmentations by felixdittrich92 in https://github.com/mindee/doctr/pull/1351
* feat: :sparkles: PT SAR Resnet31 Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1362
* feat: :sparkles: PT ViTSTR Base checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1361
* TF change antialias to true by felixT2K in https://github.com/mindee/doctr/pull/1348
* feat: :sparkles: PT Linknet Resnet18 Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1387
* [demo] remove limitation and update demo by felixdittrich92 in https://github.com/mindee/doctr/pull/1390
* feat: :sparkles: PT Linknet Resnet50 Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1391
* feat: :sparkles: PT Linknet Resnet 34 Checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1393
* [Fixes / docs] Add more vocabs / Fix Style / HF hub / API Dep by felixdittrich92 in https://github.com/mindee/doctr/pull/1412
* fix: :bug: add sqlite dependency by odulcy-mindee in https://github.com/mindee/doctr/pull/1421
* feat: :sparkles: new TF Linknet Resnet checkpoints by odulcy-mindee in https://github.com/mindee/doctr/pull/1424
* feat: :sparkles: PT db_resnet34 checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1433
* [references] TF / PT crop & document orientation classifier train scripts by felixdittrich92 in https://github.com/mindee/doctr/pull/1432
* [PT] remove submodule from textnet arch by felixdittrich92 in https://github.com/mindee/doctr/pull/1436
* [references] Add poly scheduler for detection training by felixdittrich92 in https://github.com/mindee/doctr/pull/1444
* [references] Add interval saving for detection trainings by felixdittrich92 in https://github.com/mindee/doctr/pull/1454
* feat: :sparkles: PT db_resnet50 checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1465
* read labels in utf-8 and log input string on vocab error by eikaramba in https://github.com/mindee/doctr/pull/1479
* feat: :sparkles: tf db_resnet50 checkpoint by odulcy-mindee in https://github.com/mindee/doctr/pull/1480
* feat: :sparkles: TF db mobilenet v3 large new ckpt by odulcy-mindee in https://github.com/mindee/doctr/pull/1483
* [Docs] extend doc with DocumentBuilder options by felixdittrich92 in https://github.com/mindee/doctr/pull/1486
* feat: ✨ TF db mobilenet v3 large new ckpt by odulcy-mindee in https://github.com/mindee/doctr/pull/1487
Miscellaneous
* chore: apply post release modifications v0.7.0 by felixdittrich92 in https://github.com/mindee/doctr/pull/1309
* docs: :pencil2: fix images on pypi by odulcy-mindee in https://github.com/mindee/doctr/pull/1310
* Update Dockerfile (GPU Support, Workdir, Permissions) by ffalkenberg in https://github.com/mindee/doctr/pull/1313
* [misc] rename helper function for bf16 to float32 casting by felixdittrich92 in https://github.com/mindee/doctr/pull/1347
* hebrew letters by uriva in https://github.com/mindee/doctr/pull/1355
* docs: :pencil2: add `WILDRECEIPT` in docs and fix `README.md` by odulcy-mindee in https://github.com/mindee/doctr/pull/1363
* [misc] increase to 0.8.0 and temp pin onnx by felixT2K in https://github.com/mindee/doctr/pull/1365
* [Fix] Typo in README.md by eltociear in https://github.com/mindee/doctr/pull/1374
* Relax Pillow and OpenCV version bounds. by nh2 in https://github.com/mindee/doctr/pull/1373
* [misc & build] replace isort pydocstyle and black with ruff by felixdittrich92 in https://github.com/mindee/doctr/pull/1379
* [Misc] rename char classifiation scripts and dependency pin by felixdittrich92 in https://github.com/mindee/doctr/pull/1469
* [Docs] add PyTorch / TensorFlow benchmarks by felixdittrich92 in https://github.com/mindee/doctr/pull/1321
* [misc] rename channel by felixdittrich92 in https://github.com/mindee/doctr/pull/1488

New Contributors
* ffalkenberg made their first contribution in https://github.com/mindee/doctr/pull/1313
* chunyuan-w made their first contribution in https://github.com/mindee/doctr/pull/1342
* uriva made their first contribution in https://github.com/mindee/doctr/pull/1355
* simonw made their first contribution in https://github.com/mindee/doctr/pull/1367
* nh2 made their first contribution in https://github.com/mindee/doctr/pull/1373
* SkaarFacee made their first contribution in https://github.com/mindee/doctr/pull/1397
* eikaramba made their first contribution in https://github.com/mindee/doctr/pull/1479

**Full Changelog**: https://github.com/mindee/doctr/compare/v0.7.0...v0.8.0

0.7.0

<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

0.6.0

<p align="center">
<img src="https://user-images.githubusercontent.com/76527547/135670324-5fee4530-26f9-413b-b6e0-282cdfbd746a.gif" width="50%">
</p>

Highlights of the release:

**Note**: doctr 0.6.0 requires either TensorFlow >= 2.9.0 or PyTorch >= 1.8.0.

Full integration with Huggingface Hub (docTR meets Huggingface)

![hf](https://assets.st-note.com/production/uploads/images/35450010/rectangle_large_type_2_7f287c8bb8ad90f69c4a537719b32ace.png?fit=bounds&quality=85&width=1280)

- Loading from hub:


from doctr.io import DocumentFile
from doctr.models import ocr_predictor, from_hub
image = DocumentFile.from_images(['data/example.jpg'])
Load a custom detection model from huggingface hub
det_model = from_hub('Felix92/doctr-torch-db-mobilenet-v3-large')
Load a custom recognition model from huggingface hub
reco_model = from_hub('Felix92/doctr-torch-crnn-mobilenet-v3-large-french')
You can easily plug in this models to the OCR predictor
predictor = ocr_predictor(det_arch=det_model, reco_arch=reco_model)
result = predictor(image)


- Pushing to the hub:


from doctr.models import recognition, login_to_hub, push_to_hf_hub
login_to_hub()
my_awesome_model = recognition.crnn_mobilenet_v3_large(pretrained=True)
push_to_hf_hub(my_awesome_model, model_name='doctr-crnn-mobilenet-v3-large-french-v1', task='recognition', arch='crnn_mobilenet_v3_large')

Documentation: https://mindee.github.io/doctr/using_doctr/sharing_models.html

Predefined datasets can be used also for recognition task


from doctr.datasets import CORD
Crop boxes as is (can contain irregular)
train_set = CORD(train=True, download=True, recognition_task=True)
Crop rotated boxes (always regular)
train_set = CORD(train=True, download=True, use_polygons=True, recognition_task=True)
img, target = train_set[0]

Documentation: https://mindee.github.io/doctr/using_doctr/using_datasets.html

New models (both frameworks)

- classification: VisionTransformer (ViT)
- recognition: Vision Transformer for Scene Text Recognition (ViTSTR)

Bug fixes recognition models

- MASTER and SAR architectures are now operational in both frameworks (TensorFlow and PyTorch)

ONNX support (experimential)

- All models can now be exported into ONNX format (only TF mobilenet left for 0.7.0)

NOTE: full production pipeline with ONNX / build is planned for 0.7.0 (the models can be only exported up to the logits without any post processing included)

Further features

- our demo is now also PyTorch compatible, thanks to odulcy-mindee
- it is now possible to detect the language of the extracted text, thanks to aminemindee


What's Changed
Breaking Changes 🛠
* feat: :sparkles: allow beam width > 1 in the CRNN postprocessor by khalidMindee in https://github.com/mindee/doctr/pull/630
* [Fix] TensorFlow SAR_Resnet31 implementation by felixdittrich92 in https://github.com/mindee/doctr/pull/925
New Features
* [onnx] classification models export by felixdittrich92 in https://github.com/mindee/doctr/pull/830
* feat: Added Vietnamese entry in VOCAB by calibretaliation in https://github.com/mindee/doctr/pull/878
* feat: Added Czech to the set of vocabularies in datasets/vocabs.py by Xargonus in https://github.com/mindee/doctr/pull/885
* feat: Add ability to upload PT/TF models to Huggingface Hub by felixdittrich92 in https://github.com/mindee/doctr/pull/881
* [feature][tf/pt] integrate from_hub for all tasks by felixdittrich92 in https://github.com/mindee/doctr/pull/892
* [feature] Part 2 from use datasets for recognition by felixdittrich92 in https://github.com/mindee/doctr/pull/891
* [datasets] Add MJSynth (Synth90K) by felixdittrich92 in https://github.com/mindee/doctr/pull/827
* [docu]: add documentation for datasets by felixdittrich92 in https://github.com/mindee/doctr/pull/905
* add a Slack Community badge by fharper in https://github.com/mindee/doctr/pull/936
* Feat/add language detection by aminemindee in https://github.com/mindee/doctr/pull/1023
* add ViT as classification model TF and PT by felixdittrich92 in https://github.com/mindee/doctr/pull/1050
* [models] add ViTSTR TF and PT and update ViT to work as backbone by felixdittrich92 in https://github.com/mindee/doctr/pull/1055
Bug Fixes
* [PyTorch][references] fix pretrained with different vocabs by felixdittrich92 in https://github.com/mindee/doctr/pull/874
* [classification] Fix cfgs by felixdittrich92 in https://github.com/mindee/doctr/pull/883
* docs: Fixed typo in installation instructions by frgfm in https://github.com/mindee/doctr/pull/901
* [Fix] imgur5k test by felixdittrich92 in https://github.com/mindee/doctr/pull/903
* fix: Fixed load_pretrained_params in PyTorch when ignoring keys by frgfm in https://github.com/mindee/doctr/pull/902
* [Fix]: Documentation add missing in vocabs and correct tab in sharing models by felixdittrich92 in https://github.com/mindee/doctr/pull/904
* Fix links in readme by jsn5 in https://github.com/mindee/doctr/pull/937
* [Fix] PyTorch MASTER implementation by felixdittrich92 in https://github.com/mindee/doctr/pull/941
* [Fix] MJSynth dataset: filter corrupted or missing images by felixdittrich92 in https://github.com/mindee/doctr/pull/956
* [Fix] SVT dataset: clip box values and add shape and label check by felixdittrich92 in https://github.com/mindee/doctr/pull/955
* [Fix] Tensorflow MASTER implementation by felixdittrich92 in https://github.com/mindee/doctr/pull/949
* [FIX] MASTER AMP and onnxruntime issue with master PT by felixdittrich92 in https://github.com/mindee/doctr/pull/986
* pytest-api test: fix ping server step by odulcy-mindee in https://github.com/mindee/doctr/pull/997
* docs/index: fix two minor typos by mara004 in https://github.com/mindee/doctr/pull/1002
* Fix orientation details export by aminemindee in https://github.com/mindee/doctr/pull/1022
* Changed return type of multithread_exec to iterator by mtvch in https://github.com/mindee/doctr/pull/1019
* [datasets] Fix recognition parts of SynthText and IMGUR5K by felixdittrich92 in https://github.com/mindee/doctr/pull/1038
* [Fix] rotation classifier input move to model device by felixdittrich92 in https://github.com/mindee/doctr/pull/1039
* [models] Vit: fix intermediate size scale and unify TF to PT by felixdittrich92 in https://github.com/mindee/doctr/pull/1063
Improvements
* chore: Applied post release modifications v0.5.1 by felixdittrich92 in https://github.com/mindee/doctr/pull/870
* [refactor][fix]: Part1 from use datasets for recognition task by felixdittrich92 in https://github.com/mindee/doctr/pull/889
* ci: Add swagger ping in API CI job by frgfm in https://github.com/mindee/doctr/pull/906
* [docs] Add naming conventions for upload models to hf hub by felixdittrich92 in https://github.com/mindee/doctr/pull/921
* docs: Improved error message of encode_string by frgfm in https://github.com/mindee/doctr/pull/929
* [Refactor] PyTorch SAR_Resnet31 make it ONNX exportable (again) by felixdittrich92 in https://github.com/mindee/doctr/pull/930
* Add support page in README by jonathanMindee in https://github.com/mindee/doctr/pull/946
* [references] Add eval recognition and update eval detection scripts by felixdittrich92 in https://github.com/mindee/doctr/pull/933
* update pypdfium2 dep and improve code quality by felixdittrich92 in https://github.com/mindee/doctr/pull/953
* docs: Moved need help section after code snippet by frgfm in https://github.com/mindee/doctr/pull/959
* chore: Updated TF requirements to fix grouped convolutions on CPU by frgfm in https://github.com/mindee/doctr/pull/963
* style: Fixed mypy and moved tool configs to pyproject.toml by frgfm in https://github.com/mindee/doctr/pull/966
* Updating the readme by Atomme1 in https://github.com/mindee/doctr/pull/938
* Update docs in `using_doctr` by odulcy-mindee in https://github.com/mindee/doctr/pull/993
* feat: add a basic example of text detection by ianardee in https://github.com/mindee/doctr/pull/999
* Add pytorch demo by odulcy-mindee in https://github.com/mindee/doctr/pull/1008
* [build] move requirements to pyproject.toml by felixdittrich92 in https://github.com/mindee/doctr/pull/1031
* Migrate static data from github to monitoring middleware. by marvinmindee in https://github.com/mindee/doctr/pull/1033
* Changes needed to be able to use doctr on AWS Lambda by mtvch in https://github.com/mindee/doctr/pull/1017
* [Fix] unify recognition dataset parts return signature by felixdittrich92 in https://github.com/mindee/doctr/pull/1041
* Updated README.md for custom fonts by carl-krikorian in https://github.com/mindee/doctr/pull/1051
* [refactor] detection script by felixdittrich92 in https://github.com/mindee/doctr/pull/1060
* [models] ViT add checkpoints and some rework to use pretrained ViT backbone in ViTSTR by felixdittrich92 in https://github.com/mindee/doctr/pull/1072
* upgrade pypdfium2 by felixdittrich92 in https://github.com/mindee/doctr/pull/1075
* ViTSTR disable pretrained backbone by default by felixdittrich92 in https://github.com/mindee/doctr/pull/1080
Miscellaneous
* [Refactor] commit tags by felixdittrich92 in https://github.com/mindee/doctr/pull/871
* Update `io/pdf.py` to new pypdfium2 API by mara004 in https://github.com/mindee/doctr/pull/944
* docs: Documentation the reason for keras version specifier by frgfm in https://github.com/mindee/doctr/pull/958
* [datasets] update IC / SROIE / FUNSD / CORD by felixdittrich92 in https://github.com/mindee/doctr/pull/983
* [datasets] revert whitespace filtering and fix svhn reco by felixdittrich92 in https://github.com/mindee/doctr/pull/987
* fix: update tensorflow-addons to match tensorflow version by ianardee in https://github.com/mindee/doctr/pull/998
* move transformers implementation to modules by felixdittrich92 in https://github.com/mindee/doctr/pull/1013
* [FIX] revert dev deps mistake by felixdittrich92 in https://github.com/mindee/doctr/pull/1047
* [models] update vit and transformer layer norm by felixdittrich92 in https://github.com/mindee/doctr/pull/1059
* make pretrained backbone flexible in predictor by felixdittrich92 in https://github.com/mindee/doctr/pull/1061
* handle LocalizationConfusion memory consuption and upgrade min weasyprint version by felixdittrich92 in https://github.com/mindee/doctr/pull/1062
* Fixed small typo in references recognition by carl-krikorian in https://github.com/mindee/doctr/pull/1070
* [docs] install extras for MacBooks with M1 chip by felixdittrich92 in https://github.com/mindee/doctr/pull/1076
* update version for minor release by felixdittrich92 in https://github.com/mindee/doctr/pull/1073

New Contributors
* calibretaliation made their first contribution in https://github.com/mindee/doctr/pull/878
* Xargonus made their first contribution in https://github.com/mindee/doctr/pull/885
* khalidMindee made their first contribution in https://github.com/mindee/doctr/pull/630
* frgfm made their first contribution in https://github.com/mindee/doctr/pull/901
* jsn5 made their first contribution in https://github.com/mindee/doctr/pull/937
* fharper made their first contribution in https://github.com/mindee/doctr/pull/936
* jonathanMindee made their first contribution in https://github.com/mindee/doctr/pull/946
* Atomme1 made their first contribution in https://github.com/mindee/doctr/pull/938
* odulcy-mindee made their first contribution in https://github.com/mindee/doctr/pull/993
* ianardee made their first contribution in https://github.com/mindee/doctr/pull/998
* aminemindee made their first contribution in https://github.com/mindee/doctr/pull/1022
* mtvch made their first contribution in https://github.com/mindee/doctr/pull/1019
* marvinmindee made their first contribution in https://github.com/mindee/doctr/pull/1033
* carl-krikorian made their first contribution in https://github.com/mindee/doctr/pull/1051

**Full Changelog**: https://github.com/mindee/doctr/compare/v0.5.1...v0.6.0

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.