python-doctr 1.1.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_doctr-1.1.0/python_doctr.egg-info → python_doctr-1.2.0}/PKG-INFO +54 -224
- {python_doctr-1.1.0 → python_doctr-1.2.0}/README.md +31 -3
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/cli/main.py +186 -23
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/detection.py +12 -2
- python_doctr-1.2.0/doctr/datasets/generator/base.py +238 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/generator/pytorch.py +1 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/ic03.py +6 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/layout.py +7 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/recognition.py +3 -3
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/svt.py +7 -6
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/utils.py +100 -26
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/vocabs.py +320 -150
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/__init__.py +2 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/elements.py +138 -20
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/exporters.py +848 -208
- python_doctr-1.2.0/doctr/io/figures.py +313 -0
- python_doctr-1.2.0/doctr/io/image/base.py +100 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/image/pytorch.py +14 -8
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/pdf.py +6 -5
- python_doctr-1.2.0/doctr/io/reader.py +329 -0
- python_doctr-1.2.0/doctr/io/sources.py +636 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/__init__.py +1 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/_utils.py +150 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/builder.py +316 -334
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/__init__.py +1 -0
- python_doctr-1.2.0/doctr/models/classification/hgnetv2/pytorch.py +352 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/predictor/pytorch.py +28 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/zoo.py +11 -2
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/core.py +1 -2
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/differentiable_binarization/base.py +17 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/differentiable_binarization/pytorch.py +7 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/fast/base.py +17 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/fast/pytorch.py +21 -8
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/linknet/base.py +17 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/linknet/pytorch.py +7 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/predictor/pytorch.py +40 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/zoo.py +4 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/factory/hub.py +5 -2
- python_doctr-1.2.0/doctr/models/formula/__init__.py +2 -0
- python_doctr-1.2.0/doctr/models/formula/formulanet/base.py +70 -0
- python_doctr-1.2.0/doctr/models/formula/formulanet/pytorch.py +587 -0
- python_doctr-1.2.0/doctr/models/formula/predictor/pytorch.py +132 -0
- python_doctr-1.2.0/doctr/models/formula/zoo.py +102 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/kie_predictor/base.py +7 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/kie_predictor/pytorch.py +47 -6
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/lw_detr/pytorch.py +150 -93
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/predictor/pytorch.py +32 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/zoo.py +4 -0
- python_doctr-1.2.0/doctr/models/modules/transformer/pytorch.py +321 -0
- python_doctr-1.2.0/doctr/models/predictor/base.py +592 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/predictor/pytorch.py +53 -98
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/preprocessor/pytorch.py +13 -11
- python_doctr-1.2.0/doctr/models/reading_order/base.py +1127 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/core.py +14 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/crnn/pytorch.py +37 -11
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/master/base.py +4 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/master/pytorch.py +83 -20
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/parseq/base.py +4 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/parseq/pytorch.py +123 -22
- python_doctr-1.2.0/doctr/models/recognition/predictor/_utils.py +253 -0
- python_doctr-1.2.0/doctr/models/recognition/predictor/pytorch.py +141 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/sar/pytorch.py +20 -6
- python_doctr-1.2.0/doctr/models/recognition/utils.py +123 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/viptr/pytorch.py +37 -11
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/vitstr/base.py +4 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/vitstr/pytorch.py +7 -3
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/zoo.py +31 -3
- python_doctr-1.2.0/doctr/models/table_structure/grid.py +430 -0
- python_doctr-1.2.0/doctr/models/table_structure/predictor/pytorch.py +231 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/table_structure/tablecenternet/base.py +206 -16
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/table_structure/tablecenternet/pytorch.py +8 -5
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/table_structure/zoo.py +5 -0
- python_doctr-1.2.0/doctr/models/utils/__init__.py +1 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/utils/pytorch.py +73 -16
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/zoo.py +53 -4
- python_doctr-1.2.0/doctr/transforms/functional/__init__.py +1 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/transforms/functional/base.py +6 -0
- python_doctr-1.2.0/doctr/transforms/functional/pytorch.py +265 -0
- python_doctr-1.2.0/doctr/transforms/modules/__init__.py +2 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/transforms/modules/base.py +17 -3
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/transforms/modules/pytorch.py +185 -4
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/data.py +20 -9
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/fonts.py +17 -9
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/geometry.py +36 -14
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/metrics.py +143 -13
- python_doctr-1.2.0/doctr/utils/multithreading.py +171 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/visualization.py +11 -7
- python_doctr-1.2.0/doctr/version.py +1 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/pyproject.toml +27 -20
- {python_doctr-1.1.0 → python_doctr-1.2.0/python_doctr.egg-info}/PKG-INFO +54 -224
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/SOURCES.txt +12 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/requires.txt +21 -17
- {python_doctr-1.1.0 → python_doctr-1.2.0}/setup.py +2 -1
- python_doctr-1.1.0/doctr/datasets/generator/base.py +0 -155
- python_doctr-1.1.0/doctr/io/image/base.py +0 -54
- python_doctr-1.1.0/doctr/io/reader.py +0 -79
- python_doctr-1.1.0/doctr/models/modules/transformer/pytorch.py +0 -201
- python_doctr-1.1.0/doctr/models/predictor/base.py +0 -316
- python_doctr-1.1.0/doctr/models/reading_order/base.py +0 -667
- python_doctr-1.1.0/doctr/models/recognition/predictor/_utils.py +0 -136
- python_doctr-1.1.0/doctr/models/recognition/predictor/pytorch.py +0 -85
- python_doctr-1.1.0/doctr/models/recognition/utils.py +0 -91
- python_doctr-1.1.0/doctr/models/table_structure/predictor/pytorch.py +0 -80
- python_doctr-1.1.0/doctr/transforms/functional/pytorch.py +0 -137
- python_doctr-1.1.0/doctr/utils/multithreading.py +0 -51
- python_doctr-1.1.0/doctr/version.py +0 -1
- {python_doctr-1.1.0 → python_doctr-1.2.0}/LICENSE +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/cli/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/contrib/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/contrib/artefacts.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/contrib/base.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/coco_text.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/cord.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/datasets/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/datasets/base.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/datasets/pytorch.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/doc_artefacts.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/funsd.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/generator/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/ic13.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/iiit5k.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/iiithws.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/imgur5k.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/mjsynth.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/ocr.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/orientation.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/sroie.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/svhn.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/synthtext.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/table_structure.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/datasets/wildreceipt.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/file_utils.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/html.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/io/image/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/magc_resnet → python_doctr-1.2.0/doctr/models/classification/hgnetv2}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/mobilenet → python_doctr-1.2.0/doctr/models/classification/magc_resnet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/magc_resnet/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/predictor → python_doctr-1.2.0/doctr/models/classification/mobilenet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/mobilenet/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/resnet → python_doctr-1.2.0/doctr/models/classification/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/starnet → python_doctr-1.2.0/doctr/models/classification/resnet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/resnet/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/textnet → python_doctr-1.2.0/doctr/models/classification/starnet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/starnet/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vgg → python_doctr-1.2.0/doctr/models/classification/textnet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/textnet/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vip → python_doctr-1.2.0/doctr/models/classification/vgg}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vgg/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vip/layers → python_doctr-1.2.0/doctr/models/classification/vip}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vit → python_doctr-1.2.0/doctr/models/classification/vip/layers}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vip/layers/pytorch.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vip/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vit_det → python_doctr-1.2.0/doctr/models/classification/vit}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vit/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/classification/vit_det/layers → python_doctr-1.2.0/doctr/models/classification/vit_det}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/detection/differentiable_binarization → python_doctr-1.2.0/doctr/models/classification/vit_det/layers}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vit_det/layers/pytorch.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/classification/vit_det/pytorch.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/core.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/_utils/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/_utils/base.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/detection/_utils/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/detection/fast → python_doctr-1.2.0/doctr/models/detection/differentiable_binarization}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/detection/linknet → python_doctr-1.2.0/doctr/models/detection/fast}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/detection/predictor → python_doctr-1.2.0/doctr/models/detection/linknet}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/kie_predictor → python_doctr-1.2.0/doctr/models/detection/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/factory/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/table_structure/tablecenternet → python_doctr-1.2.0/doctr/models/formula/formulanet}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/layout/lw_detr → python_doctr-1.2.0/doctr/models/formula/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/layout/lw_detr/layers → python_doctr-1.2.0/doctr/models/kie_predictor}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/layout/predictor → python_doctr-1.2.0/doctr/models/layout/lw_detr}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/lw_detr/base.py +0 -0
- {python_doctr-1.1.0/doctr/models/modules → python_doctr-1.2.0/doctr/models/layout/lw_detr}/layers/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/layout/lw_detr/layers/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/modules/transformer → python_doctr-1.2.0/doctr/models/layout/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/modules/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/modules/vision_transformer → python_doctr-1.2.0/doctr/models/modules/layers}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/modules/layers/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/predictor → python_doctr-1.2.0/doctr/models/modules/transformer}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/preprocessor → python_doctr-1.2.0/doctr/models/modules/vision_transformer}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/modules/vision_transformer/pytorch.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/crnn → python_doctr-1.2.0/doctr/models/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/master → python_doctr-1.2.0/doctr/models/preprocessor}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/reading_order/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/recognition/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/parseq → python_doctr-1.2.0/doctr/models/recognition/crnn}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/predictor → python_doctr-1.2.0/doctr/models/recognition/master}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/sar → python_doctr-1.2.0/doctr/models/recognition/parseq}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/viptr → python_doctr-1.2.0/doctr/models/recognition/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/recognition/vitstr → python_doctr-1.2.0/doctr/models/recognition/sar}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/table_structure/predictor → python_doctr-1.2.0/doctr/models/recognition/viptr}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/models/utils → python_doctr-1.2.0/doctr/models/recognition/vitstr}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/models/table_structure/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/transforms/functional → python_doctr-1.2.0/doctr/models/table_structure/predictor}/__init__.py +0 -0
- {python_doctr-1.1.0/doctr/transforms/modules → python_doctr-1.2.0/doctr/models/table_structure/tablecenternet}/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/py.typed +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/transforms/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/__init__.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/common_types.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/reconstitution.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/doctr/utils/repr.py +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/dependency_links.txt +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/entry_points.txt +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/top_level.txt +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/python_doctr.egg-info/zip-safe +0 -0
- {python_doctr-1.1.0 → python_doctr-1.2.0}/setup.cfg +0 -0
|
@@ -1,211 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-doctr
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Document Text Recognition (docTR): deep Learning for high-performance OCR on documents.
|
|
5
5
|
Author-email: Mindee <contact@mindee.com>
|
|
6
6
|
Maintainer: François-Guillaume Fernandez, Charles Gaillard, Olivier Dulcy, Felix Dittrich
|
|
7
|
-
License:
|
|
8
|
-
Version 2.0, January 2004
|
|
9
|
-
http://www.apache.org/licenses/
|
|
10
|
-
|
|
11
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
12
|
-
|
|
13
|
-
1. Definitions.
|
|
14
|
-
|
|
15
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
16
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
17
|
-
|
|
18
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
19
|
-
the copyright owner that is granting the License.
|
|
20
|
-
|
|
21
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
22
|
-
other entities that control, are controlled by, or are under common
|
|
23
|
-
control with that entity. For the purposes of this definition,
|
|
24
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
25
|
-
direction or management of such entity, whether by contract or
|
|
26
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
27
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
28
|
-
|
|
29
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
30
|
-
exercising permissions granted by this License.
|
|
31
|
-
|
|
32
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
33
|
-
including but not limited to software source code, documentation
|
|
34
|
-
source, and configuration files.
|
|
35
|
-
|
|
36
|
-
"Object" form shall mean any form resulting from mechanical
|
|
37
|
-
transformation or translation of a Source form, including but
|
|
38
|
-
not limited to compiled object code, generated documentation,
|
|
39
|
-
and conversions to other media types.
|
|
40
|
-
|
|
41
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
42
|
-
Object form, made available under the License, as indicated by a
|
|
43
|
-
copyright notice that is included in or attached to the work
|
|
44
|
-
(an example is provided in the Appendix below).
|
|
45
|
-
|
|
46
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
47
|
-
form, that is based on (or derived from) the Work and for which the
|
|
48
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
49
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
50
|
-
of this License, Derivative Works shall not include works that remain
|
|
51
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
52
|
-
the Work and Derivative Works thereof.
|
|
53
|
-
|
|
54
|
-
"Contribution" shall mean any work of authorship, including
|
|
55
|
-
the original version of the Work and any modifications or additions
|
|
56
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
57
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
58
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
59
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
60
|
-
means any form of electronic, verbal, or written communication sent
|
|
61
|
-
to the Licensor or its representatives, including but not limited to
|
|
62
|
-
communication on electronic mailing lists, source code control systems,
|
|
63
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
64
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
65
|
-
excluding communication that is conspicuously marked or otherwise
|
|
66
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
67
|
-
|
|
68
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
69
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
70
|
-
subsequently incorporated within the Work.
|
|
71
|
-
|
|
72
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
73
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
74
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
75
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
76
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
77
|
-
Work and such Derivative Works in Source or Object form.
|
|
78
|
-
|
|
79
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
80
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
81
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
82
|
-
(except as stated in this section) patent license to make, have made,
|
|
83
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
84
|
-
where such license applies only to those patent claims licensable
|
|
85
|
-
by such Contributor that are necessarily infringed by their
|
|
86
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
87
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
88
|
-
institute patent litigation against any entity (including a
|
|
89
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
90
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
91
|
-
or contributory patent infringement, then any patent licenses
|
|
92
|
-
granted to You under this License for that Work shall terminate
|
|
93
|
-
as of the date such litigation is filed.
|
|
94
|
-
|
|
95
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
96
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
97
|
-
modifications, and in Source or Object form, provided that You
|
|
98
|
-
meet the following conditions:
|
|
99
|
-
|
|
100
|
-
(a) You must give any other recipients of the Work or
|
|
101
|
-
Derivative Works a copy of this License; and
|
|
102
|
-
|
|
103
|
-
(b) You must cause any modified files to carry prominent notices
|
|
104
|
-
stating that You changed the files; and
|
|
105
|
-
|
|
106
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
107
|
-
that You distribute, all copyright, patent, trademark, and
|
|
108
|
-
attribution notices from the Source form of the Work,
|
|
109
|
-
excluding those notices that do not pertain to any part of
|
|
110
|
-
the Derivative Works; and
|
|
111
|
-
|
|
112
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
113
|
-
distribution, then any Derivative Works that You distribute must
|
|
114
|
-
include a readable copy of the attribution notices contained
|
|
115
|
-
within such NOTICE file, excluding those notices that do not
|
|
116
|
-
pertain to any part of the Derivative Works, in at least one
|
|
117
|
-
of the following places: within a NOTICE text file distributed
|
|
118
|
-
as part of the Derivative Works; within the Source form or
|
|
119
|
-
documentation, if provided along with the Derivative Works; or,
|
|
120
|
-
within a display generated by the Derivative Works, if and
|
|
121
|
-
wherever such third-party notices normally appear. The contents
|
|
122
|
-
of the NOTICE file are for informational purposes only and
|
|
123
|
-
do not modify the License. You may add Your own attribution
|
|
124
|
-
notices within Derivative Works that You distribute, alongside
|
|
125
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
126
|
-
that such additional attribution notices cannot be construed
|
|
127
|
-
as modifying the License.
|
|
128
|
-
|
|
129
|
-
You may add Your own copyright statement to Your modifications and
|
|
130
|
-
may provide additional or different license terms and conditions
|
|
131
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
132
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
133
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
134
|
-
the conditions stated in this License.
|
|
135
|
-
|
|
136
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
137
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
138
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
139
|
-
this License, without any additional terms or conditions.
|
|
140
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
141
|
-
the terms of any separate license agreement you may have executed
|
|
142
|
-
with Licensor regarding such Contributions.
|
|
143
|
-
|
|
144
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
145
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
146
|
-
except as required for reasonable and customary use in describing the
|
|
147
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
148
|
-
|
|
149
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
150
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
151
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
152
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
153
|
-
implied, including, without limitation, any warranties or conditions
|
|
154
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
155
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
156
|
-
appropriateness of using or redistributing the Work and assume any
|
|
157
|
-
risks associated with Your exercise of permissions under this License.
|
|
158
|
-
|
|
159
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
160
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
161
|
-
unless required by applicable law (such as deliberate and grossly
|
|
162
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
163
|
-
liable to You for damages, including any direct, indirect, special,
|
|
164
|
-
incidental, or consequential damages of any character arising as a
|
|
165
|
-
result of this License or out of the use or inability to use the
|
|
166
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
167
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
168
|
-
other commercial damages or losses), even if such Contributor
|
|
169
|
-
has been advised of the possibility of such damages.
|
|
170
|
-
|
|
171
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
172
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
173
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
174
|
-
or other liability obligations and/or rights consistent with this
|
|
175
|
-
License. However, in accepting such obligations, You may act only
|
|
176
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
177
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
178
|
-
defend, and hold each Contributor harmless for any liability
|
|
179
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
180
|
-
of your accepting any such warranty or additional liability.
|
|
181
|
-
|
|
182
|
-
END OF TERMS AND CONDITIONS
|
|
183
|
-
|
|
184
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
185
|
-
|
|
186
|
-
To apply the Apache License to your work, attach the following
|
|
187
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
188
|
-
replaced with your own identifying information. (Don't include
|
|
189
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
190
|
-
comment syntax for the file format. We also recommend that a
|
|
191
|
-
file or class name and description of purpose be included on the
|
|
192
|
-
same "printed page" as the copyright notice for easier
|
|
193
|
-
identification within third-party archives.
|
|
194
|
-
|
|
195
|
-
Copyright 2022 Mindee
|
|
196
|
-
|
|
197
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
198
|
-
you may not use this file except in compliance with the License.
|
|
199
|
-
You may obtain a copy of the License at
|
|
200
|
-
|
|
201
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
202
|
-
|
|
203
|
-
Unless required by applicable law or agreed to in writing, software
|
|
204
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
205
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
206
|
-
See the License for the specific language governing permissions and
|
|
207
|
-
limitations under the License.
|
|
208
|
-
|
|
7
|
+
License-Expression: Apache-2.0
|
|
209
8
|
Project-URL: documentation, https://mindee.github.io/doctr
|
|
210
9
|
Project-URL: repository, https://github.com/mindee/doctr
|
|
211
10
|
Project-URL: tracker, https://github.com/mindee/doctr/issues
|
|
@@ -215,7 +14,6 @@ Classifier: Development Status :: 4 - Beta
|
|
|
215
14
|
Classifier: Intended Audience :: Developers
|
|
216
15
|
Classifier: Intended Audience :: Education
|
|
217
16
|
Classifier: Intended Audience :: Science/Research
|
|
218
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
219
17
|
Classifier: Natural Language :: English
|
|
220
18
|
Classifier: Operating System :: OS Independent
|
|
221
19
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -227,8 +25,8 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
227
25
|
Requires-Python: <4,>=3.11.0
|
|
228
26
|
Description-Content-Type: text/markdown
|
|
229
27
|
License-File: LICENSE
|
|
230
|
-
Requires-Dist: torch<3.0.0,>=2.
|
|
231
|
-
Requires-Dist: torchvision>=0.
|
|
28
|
+
Requires-Dist: torch<3.0.0,>=2.11.0
|
|
29
|
+
Requires-Dist: torchvision>=0.26.0
|
|
232
30
|
Requires-Dist: onnx<3.0.0,>=1.12.0
|
|
233
31
|
Requires-Dist: numpy<3.0.0,>=1.16.0
|
|
234
32
|
Requires-Dist: scipy<2.0.0,>=1.4.0
|
|
@@ -239,7 +37,7 @@ Requires-Dist: pyclipper<2.0.0,>=1.2.0
|
|
|
239
37
|
Requires-Dist: shapely<3.0.0,>=1.6.0
|
|
240
38
|
Requires-Dist: langdetect<2.0.0,>=1.0.9
|
|
241
39
|
Requires-Dist: rapidfuzz<4.0.0,>=3.0.0
|
|
242
|
-
Requires-Dist: huggingface-hub<
|
|
40
|
+
Requires-Dist: huggingface-hub<3.0.0,>=1.0.0
|
|
243
41
|
Requires-Dist: Pillow>=10.1.0
|
|
244
42
|
Requires-Dist: anyascii>=0.3.2
|
|
245
43
|
Requires-Dist: validators>=0.18.0
|
|
@@ -254,6 +52,7 @@ Requires-Dist: onnxruntime>=1.11.0; extra == "contrib"
|
|
|
254
52
|
Provides-Extra: testing
|
|
255
53
|
Requires-Dist: pytest-cov>=7.0.0; extra == "testing"
|
|
256
54
|
Requires-Dist: onnxruntime>=1.11.0; extra == "testing"
|
|
55
|
+
Requires-Dist: onnxscript>=0.5.0; extra == "testing"
|
|
257
56
|
Requires-Dist: requests>=2.20.0; extra == "testing"
|
|
258
57
|
Requires-Dist: psutil>=5.9.5; extra == "testing"
|
|
259
58
|
Requires-Dist: pandas>=2.0.0; extra == "testing"
|
|
@@ -262,44 +61,47 @@ Requires-Dist: ruff>=0.1.5; extra == "quality"
|
|
|
262
61
|
Requires-Dist: mypy>=0.812; extra == "quality"
|
|
263
62
|
Requires-Dist: pre-commit>=2.17.0; extra == "quality"
|
|
264
63
|
Provides-Extra: docs
|
|
265
|
-
Requires-Dist: sphinx
|
|
266
|
-
Requires-Dist: sphinxemoji>=0.1.8; extra == "docs"
|
|
267
|
-
Requires-Dist: sphinx-copybutton>=0.3.1; extra == "docs"
|
|
64
|
+
Requires-Dist: sphinx>=8.0.0; extra == "docs"
|
|
268
65
|
Requires-Dist: docutils<0.23; extra == "docs"
|
|
269
|
-
Requires-Dist:
|
|
270
|
-
Requires-Dist:
|
|
66
|
+
Requires-Dist: pydata-sphinx-theme>=0.23.0; extra == "docs"
|
|
67
|
+
Requires-Dist: myst-parser>=4.0.0; extra == "docs"
|
|
68
|
+
Requires-Dist: sphinx-design>=0.6.0; extra == "docs"
|
|
69
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
|
|
70
|
+
Requires-Dist: sphinx-reredirects>=0.1.5; extra == "docs"
|
|
71
|
+
Requires-Dist: sphinxemoji>=0.1.8; extra == "docs"
|
|
271
72
|
Requires-Dist: sphinx-tabs>=3.3.0; extra == "docs"
|
|
272
|
-
Requires-Dist: furo>=2022.3.4; extra == "docs"
|
|
273
73
|
Provides-Extra: dev
|
|
274
|
-
Requires-Dist: torch<3.0.0,>=2.
|
|
275
|
-
Requires-Dist: torchvision>=0.
|
|
74
|
+
Requires-Dist: torch<3.0.0,>=2.11.0; extra == "dev"
|
|
75
|
+
Requires-Dist: torchvision>=0.26.0; extra == "dev"
|
|
276
76
|
Requires-Dist: onnx<3.0.0,>=1.12.0; extra == "dev"
|
|
277
77
|
Requires-Dist: weasyprint>=55.0; extra == "dev"
|
|
278
78
|
Requires-Dist: matplotlib>=3.1.0; extra == "dev"
|
|
279
79
|
Requires-Dist: mplcursors>=0.3; extra == "dev"
|
|
280
80
|
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
|
|
281
81
|
Requires-Dist: onnxruntime>=1.11.0; extra == "dev"
|
|
82
|
+
Requires-Dist: onnxscript>=0.5.0; extra == "dev"
|
|
282
83
|
Requires-Dist: requests>=2.20.0; extra == "dev"
|
|
283
84
|
Requires-Dist: psutil>=5.9.5; extra == "dev"
|
|
284
85
|
Requires-Dist: pandas>=2.0.0; extra == "dev"
|
|
285
86
|
Requires-Dist: ruff>=0.3.0; extra == "dev"
|
|
286
87
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
287
88
|
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
288
|
-
Requires-Dist: sphinx
|
|
289
|
-
Requires-Dist: sphinxemoji>=0.1.8; extra == "dev"
|
|
290
|
-
Requires-Dist: sphinx-copybutton>=0.3.1; extra == "dev"
|
|
89
|
+
Requires-Dist: sphinx>=8.0.0; extra == "dev"
|
|
291
90
|
Requires-Dist: docutils<0.23; extra == "dev"
|
|
292
|
-
Requires-Dist:
|
|
293
|
-
Requires-Dist:
|
|
91
|
+
Requires-Dist: pydata-sphinx-theme>=0.23.0; extra == "dev"
|
|
92
|
+
Requires-Dist: myst-parser>=4.0.0; extra == "dev"
|
|
93
|
+
Requires-Dist: sphinx-design>=0.6.0; extra == "dev"
|
|
94
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "dev"
|
|
95
|
+
Requires-Dist: sphinx-reredirects>=0.1.5; extra == "dev"
|
|
96
|
+
Requires-Dist: sphinxemoji>=0.1.8; extra == "dev"
|
|
294
97
|
Requires-Dist: sphinx-tabs>=3.3.0; extra == "dev"
|
|
295
|
-
Requires-Dist: furo>=2022.3.4; extra == "dev"
|
|
296
98
|
Dynamic: license-file
|
|
297
99
|
|
|
298
100
|
<p align="center">
|
|
299
101
|
<img src="https://github.com/mindee/doctr/raw/main/docs/images/Logo_doctr.gif" width="40%">
|
|
300
102
|
</p>
|
|
301
103
|
|
|
302
|
-
[](https://slack.mindee.com) [](LICENSE)  [](https://github.com/mindee/doctr/pkgs/container/doctr) [](https://codecov.io/gh/mindee/doctr) [](https://www.codefactor.io/repository/github/mindee/doctr) [](https://app.codacy.com/gh/mindee/doctr?utm_source=github.com&utm_medium=referral&utm_content=mindee/doctr&utm_campaign=Badge_Grade) [](https://mindee.github.io/doctr) [](https://slack.mindee.com) [](LICENSE)  [](https://github.com/mindee/doctr/pkgs/container/doctr) [](https://codecov.io/gh/mindee/doctr) [](https://www.codefactor.io/repository/github/mindee/doctr) [](https://app.codacy.com/gh/mindee/doctr?utm_source=github.com&utm_medium=referral&utm_content=mindee/doctr&utm_campaign=Badge_Grade) [](https://mindee.github.io/doctr) [](https://pypi.org/project/python-doctr/) [](https://huggingface.co/spaces/mindee/doctr) [](https://colab.research.google.com/github/mindee/notebooks/blob/main/doctr/quicktour.ipynb) [](https://gurubase.io/g/doctr)
|
|
303
105
|
|
|
304
106
|
|
|
305
107
|
**Optical Character Recognition made seamless & accessible to anyone, powered by PyTorch**
|
|
@@ -322,7 +124,7 @@ What you can expect from this repository:
|
|
|
322
124
|
### Getting your pretrained model
|
|
323
125
|
|
|
324
126
|
End-to-End OCR is achieved in docTR using a two-stage approach: text detection (localizing words), then text recognition (identify all characters in the word).
|
|
325
|
-
As such, you can select the architecture used for [text detection](https://mindee.github.io/doctr/latest/
|
|
127
|
+
As such, you can select the architecture used for [text detection](https://mindee.github.io/doctr/latest/models/detection.html), and the one for [text recognition](https://mindee.github.io/doctr/latest/models/recognition.html) from the list of available implementations.
|
|
326
128
|
|
|
327
129
|
```python
|
|
328
130
|
from doctr.models import ocr_predictor
|
|
@@ -379,6 +181,30 @@ for region in result.pages[0].layout:
|
|
|
379
181
|
print(region.type, region.confidence, region.geometry)
|
|
380
182
|
```
|
|
381
183
|
|
|
184
|
+
### Recognizing tables and formulas
|
|
185
|
+
|
|
186
|
+
With `detect_tables=True`, the tables found by the layout model are rebuilt as a grid of rows, columns and cells. With `detect_formulas=True`, formulas are read as LaTeX. Both are rendered in the exports, e.g. as Markdown tables and `$$...$$` display math:
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from doctr.io import DocumentFile
|
|
190
|
+
from doctr.models import ocr_predictor
|
|
191
|
+
|
|
192
|
+
model = ocr_predictor(pretrained=True, detect_tables=True, detect_formulas=True)
|
|
193
|
+
doc = DocumentFile.from_pdf("path/to/your/doc.pdf")
|
|
194
|
+
result = model(doc)
|
|
195
|
+
|
|
196
|
+
page = result.pages[0]
|
|
197
|
+
# Tables: a row/column grid of strings
|
|
198
|
+
for table in page.tables:
|
|
199
|
+
print(table.num_rows, table.num_cols, table.to_grid())
|
|
200
|
+
# Formulas: the LaTeX source and its confidence
|
|
201
|
+
for formula in page.formulas:
|
|
202
|
+
print(formula.value, formula.confidence)
|
|
203
|
+
|
|
204
|
+
# Markdown export with tables and display math
|
|
205
|
+
print(result.export_as_markdown())
|
|
206
|
+
```
|
|
207
|
+
|
|
382
208
|
### Dealing with rotated documents
|
|
383
209
|
|
|
384
210
|
Should you use docTR on documents that include rotated pages, or pages with multiple box orientations,
|
|
@@ -416,7 +242,7 @@ plt.show()
|
|
|
416
242
|

|
|
417
243
|
|
|
418
244
|
The `ocr_predictor` returns a `Document` object with a nested structure (with `Page`, `Block`, `Line`, `Word`, `Artefact`).
|
|
419
|
-
To get a better understanding of our document model, check our [documentation](https://mindee.github.io/doctr/
|
|
245
|
+
To get a better understanding of our document model, check our [documentation](https://mindee.github.io/doctr/latest/getting_started/concepts.html#the-document-tree):
|
|
420
246
|
|
|
421
247
|
You can also export them as a nested dict, more appropriate for JSON format:
|
|
422
248
|
|
|
@@ -516,6 +342,10 @@ Credits where it's due: this repository is implementing, among others, architect
|
|
|
516
342
|
|
|
517
343
|
- TableCenterNet: [A one-stage network for table structure recognition](https://arxiv.org/abs/2504.17522).
|
|
518
344
|
|
|
345
|
+
### Formula Recognition
|
|
346
|
+
|
|
347
|
+
- FormulaNet (HGNetV2 encoder + transformer decoder): [PP-FormulaNet: Bridging Accuracy and Efficiency in Advanced Formula Recognition](https://arxiv.org/abs/2503.18382).
|
|
348
|
+
|
|
519
349
|
## More goodies
|
|
520
350
|
|
|
521
351
|
### Documentation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="https://github.com/mindee/doctr/raw/main/docs/images/Logo_doctr.gif" width="40%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
[](https://slack.mindee.com) [](LICENSE)  [](https://github.com/mindee/doctr/pkgs/container/doctr) [](https://codecov.io/gh/mindee/doctr) [](https://www.codefactor.io/repository/github/mindee/doctr) [](https://app.codacy.com/gh/mindee/doctr?utm_source=github.com&utm_medium=referral&utm_content=mindee/doctr&utm_campaign=Badge_Grade) [](https://mindee.github.io/doctr) [](https://slack.mindee.com) [](LICENSE)  [](https://github.com/mindee/doctr/pkgs/container/doctr) [](https://codecov.io/gh/mindee/doctr) [](https://www.codefactor.io/repository/github/mindee/doctr) [](https://app.codacy.com/gh/mindee/doctr?utm_source=github.com&utm_medium=referral&utm_content=mindee/doctr&utm_campaign=Badge_Grade) [](https://mindee.github.io/doctr) [](https://pypi.org/project/python-doctr/) [](https://huggingface.co/spaces/mindee/doctr) [](https://colab.research.google.com/github/mindee/notebooks/blob/main/doctr/quicktour.ipynb) [](https://gurubase.io/g/doctr)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
**Optical Character Recognition made seamless & accessible to anyone, powered by PyTorch**
|
|
@@ -25,7 +25,7 @@ What you can expect from this repository:
|
|
|
25
25
|
### Getting your pretrained model
|
|
26
26
|
|
|
27
27
|
End-to-End OCR is achieved in docTR using a two-stage approach: text detection (localizing words), then text recognition (identify all characters in the word).
|
|
28
|
-
As such, you can select the architecture used for [text detection](https://mindee.github.io/doctr/latest/
|
|
28
|
+
As such, you can select the architecture used for [text detection](https://mindee.github.io/doctr/latest/models/detection.html), and the one for [text recognition](https://mindee.github.io/doctr/latest/models/recognition.html) from the list of available implementations.
|
|
29
29
|
|
|
30
30
|
```python
|
|
31
31
|
from doctr.models import ocr_predictor
|
|
@@ -82,6 +82,30 @@ for region in result.pages[0].layout:
|
|
|
82
82
|
print(region.type, region.confidence, region.geometry)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
### Recognizing tables and formulas
|
|
86
|
+
|
|
87
|
+
With `detect_tables=True`, the tables found by the layout model are rebuilt as a grid of rows, columns and cells. With `detect_formulas=True`, formulas are read as LaTeX. Both are rendered in the exports, e.g. as Markdown tables and `$$...$$` display math:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from doctr.io import DocumentFile
|
|
91
|
+
from doctr.models import ocr_predictor
|
|
92
|
+
|
|
93
|
+
model = ocr_predictor(pretrained=True, detect_tables=True, detect_formulas=True)
|
|
94
|
+
doc = DocumentFile.from_pdf("path/to/your/doc.pdf")
|
|
95
|
+
result = model(doc)
|
|
96
|
+
|
|
97
|
+
page = result.pages[0]
|
|
98
|
+
# Tables: a row/column grid of strings
|
|
99
|
+
for table in page.tables:
|
|
100
|
+
print(table.num_rows, table.num_cols, table.to_grid())
|
|
101
|
+
# Formulas: the LaTeX source and its confidence
|
|
102
|
+
for formula in page.formulas:
|
|
103
|
+
print(formula.value, formula.confidence)
|
|
104
|
+
|
|
105
|
+
# Markdown export with tables and display math
|
|
106
|
+
print(result.export_as_markdown())
|
|
107
|
+
```
|
|
108
|
+
|
|
85
109
|
### Dealing with rotated documents
|
|
86
110
|
|
|
87
111
|
Should you use docTR on documents that include rotated pages, or pages with multiple box orientations,
|
|
@@ -119,7 +143,7 @@ plt.show()
|
|
|
119
143
|

|
|
120
144
|
|
|
121
145
|
The `ocr_predictor` returns a `Document` object with a nested structure (with `Page`, `Block`, `Line`, `Word`, `Artefact`).
|
|
122
|
-
To get a better understanding of our document model, check our [documentation](https://mindee.github.io/doctr/
|
|
146
|
+
To get a better understanding of our document model, check our [documentation](https://mindee.github.io/doctr/latest/getting_started/concepts.html#the-document-tree):
|
|
123
147
|
|
|
124
148
|
You can also export them as a nested dict, more appropriate for JSON format:
|
|
125
149
|
|
|
@@ -219,6 +243,10 @@ Credits where it's due: this repository is implementing, among others, architect
|
|
|
219
243
|
|
|
220
244
|
- TableCenterNet: [A one-stage network for table structure recognition](https://arxiv.org/abs/2504.17522).
|
|
221
245
|
|
|
246
|
+
### Formula Recognition
|
|
247
|
+
|
|
248
|
+
- FormulaNet (HGNetV2 encoder + transformer decoder): [PP-FormulaNet: Bridging Accuracy and Efficiency in Advanced Formula Recognition](https://arxiv.org/abs/2503.18382).
|
|
249
|
+
|
|
222
250
|
## More goodies
|
|
223
251
|
|
|
224
252
|
### Documentation
|