onnxtr 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
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.
- onnxtr/version.py +1 -1
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/METADATA +23 -9
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/RECORD +7 -7
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/LICENSE +0 -0
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/WHEEL +0 -0
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/top_level.txt +0 -0
- {onnxtr-0.1.1.dist-info → onnxtr-0.1.2.dist-info}/zip-safe +0 -0
onnxtr/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = 'v0.1.
|
|
1
|
+
__version__ = 'v0.1.2'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: onnxtr
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Onnx Text Recognition (OnnxTR): docTR Onnx-Wrapper for high-performance OCR on documents.
|
|
5
5
|
Author-email: Felix Dittrich <felixdittrich92@gmail.com>
|
|
6
6
|
Maintainer: Felix Dittrich
|
|
@@ -227,7 +227,6 @@ Description-Content-Type: text/markdown
|
|
|
227
227
|
License-File: LICENSE
|
|
228
228
|
Requires-Dist: numpy <2.0.0,>=1.16.0
|
|
229
229
|
Requires-Dist: scipy <2.0.0,>=1.4.0
|
|
230
|
-
Requires-Dist: onnx <2.0.0,>=1.12.0
|
|
231
230
|
Requires-Dist: opencv-python <5.0.0,>=4.5.0
|
|
232
231
|
Requires-Dist: pypdfium2 <5.0.0,>=4.0.0
|
|
233
232
|
Requires-Dist: pyclipper <2.0.0,>=1.2.0
|
|
@@ -276,9 +275,9 @@ Requires-Dist: mplcursors >=0.3 ; extra == 'viz'
|
|
|
276
275
|
[](https://codecov.io/gh/felixdittrich92/OnnxTR)
|
|
277
276
|
[](https://app.codacy.com/gh/felixdittrich92/OnnxTR/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
278
277
|
[](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr)
|
|
279
|
-
[](https://pypi.org/project/OnnxTR/)
|
|
280
279
|
|
|
281
|
-
> :warning: Please note that this is wrapper around the [doctr](https://github.com/mindee/doctr) library to provide a Onnx pipeline for docTR. For feature requests, which are not directly related to the Onnx pipeline, please refer to the base project.
|
|
280
|
+
> :warning: Please note that this is a wrapper around the [doctr](https://github.com/mindee/doctr) library to provide a Onnx pipeline for docTR. For feature requests, which are not directly related to the Onnx pipeline, please refer to the base project.
|
|
282
281
|
|
|
283
282
|
**Optical Character Recognition made seamless & accessible to anyone, powered by Onnx**
|
|
284
283
|
|
|
@@ -300,10 +299,14 @@ Python 3.9 (or higher) and [pip](https://pip.pypa.io/en/stable/) are required to
|
|
|
300
299
|
|
|
301
300
|
You can then install the latest release of the package using [pypi](https://pypi.org/project/OnnxTR/) as follows:
|
|
302
301
|
|
|
303
|
-
**NOTE:**
|
|
302
|
+
**NOTE:**
|
|
303
|
+
|
|
304
|
+
For GPU support please take a look at: [ONNX Runtime](https://onnxruntime.ai/getting-started). Currently supported execution providers by default are: CPU, CUDA
|
|
305
|
+
|
|
306
|
+
- **Prerequisites:** CUDA & cuDNN needs to be installed before [Version table](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html).
|
|
304
307
|
|
|
305
308
|
```shell
|
|
306
|
-
pip install onnxtr[cpu]
|
|
309
|
+
pip install "onnxtr[cpu]"
|
|
307
310
|
# with gpu support
|
|
308
311
|
pip install "onnxtr[gpu]"
|
|
309
312
|
# with HTML support
|
|
@@ -340,13 +343,17 @@ from onnxtr.models import ocr_predictor
|
|
|
340
343
|
|
|
341
344
|
model = ocr_predictor(
|
|
342
345
|
det_arch='fast_base', # detection architecture
|
|
343
|
-
|
|
346
|
+
reco_arch='vitstr_base', # recognition architecture
|
|
344
347
|
det_bs=4, # detection batch size
|
|
345
348
|
reco_bs=1024, # recognition batch size
|
|
346
349
|
assume_straight_pages=True, # set to `False` if the pages are not straight (rotation, perspective, etc.) (default: True)
|
|
347
350
|
straighten_pages=False, # set to `True` if the pages should be straightened before final processing (default: False)
|
|
351
|
+
# Preprocessing related parameters
|
|
348
352
|
preserve_aspect_ratio=True, # set to `False` if the aspect ratio should not be preserved (default: True)
|
|
349
353
|
symmetric_pad=True, # set to `False` to disable symmetric padding (default: True)
|
|
354
|
+
# Additional parameters - meta information
|
|
355
|
+
detect_orientation=False, # set to `True` if the orientation of the pages should be detected (default: False)
|
|
356
|
+
detect_language=False, # set to `True` if the language of the pages should be detected (default: False)
|
|
350
357
|
# DocumentBuilder specific parameters
|
|
351
358
|
resolve_lines=True, # whether words should be automatically grouped into lines (default: True)
|
|
352
359
|
resolve_blocks=True, # whether lines should be automatically grouped into blocks (default: True)
|
|
@@ -398,7 +405,7 @@ from onnxtr.models import ocr_predictor, linknet_resnet18, parseq
|
|
|
398
405
|
|
|
399
406
|
reco_model = parseq("path_to_custom_model.onnx", vocab="ABC")
|
|
400
407
|
det_model = linknet_resnet18("path_to_custom_model.onnx")
|
|
401
|
-
model = ocr_predictor(
|
|
408
|
+
model = ocr_predictor(det_arch=det_model, reco_arch=reco_model)
|
|
402
409
|
```
|
|
403
410
|
|
|
404
411
|
## Models architectures
|
|
@@ -462,7 +469,14 @@ NOTE:
|
|
|
462
469
|
|
|
463
470
|
### Benchmarks
|
|
464
471
|
|
|
465
|
-
|
|
472
|
+
The benchmarks was measured on a `i7-14700K Intel CPU`.
|
|
473
|
+
|
|
474
|
+
MORE BENCHMARKS COMING SOON
|
|
475
|
+
|
|
476
|
+
|Dataset |docTR (CPU) - v0.8.1 |OnnxTR (CPU) - v0.1.1 |
|
|
477
|
+
|--------------------------------|-------------------------------|-------------------------------|
|
|
478
|
+
|FUNSD (199 pages) | ~1.29s / Page | ~0.57s / Page |
|
|
479
|
+
|CORD (900 pages) | ~0.60s / Page | ~0.25s / Page |
|
|
466
480
|
|
|
467
481
|
## Citation
|
|
468
482
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
onnxtr/__init__.py,sha256=h7Wc2tuHLsaoCk5xNpEFEK-g11A6SJA7nAasA76TQ_Y,100
|
|
2
2
|
onnxtr/file_utils.py,sha256=WjUKalEdR53aoeIY4e-ihy3r7J_C9qFxL40JHGPfutc,1107
|
|
3
|
-
onnxtr/version.py,sha256=
|
|
3
|
+
onnxtr/version.py,sha256=t2ZLy6eqIRREzP9MNv-0UaNqpTXYFxlbMzz0JwDxS9I,23
|
|
4
4
|
onnxtr/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
onnxtr/contrib/artefacts.py,sha256=tdmfhvfXVRYEH7uj4_hqf2cuUGoTieyNK8bXsD3zHwo,5383
|
|
6
6
|
onnxtr/contrib/base.py,sha256=PoCKtOIgj7u4xl-V0eBVh-QmVeTyk_eEggFHQ8R34AI,3445
|
|
@@ -62,9 +62,9 @@ onnxtr/utils/reconstitution.py,sha256=Hx1_ddLevKLzuxXc19UelPdsGlAwqi4f6vRSYKHDUB
|
|
|
62
62
|
onnxtr/utils/repr.py,sha256=kfbjGL6KymGT8spo2UL4FJXZ0XRwa7CO7Y1dTVR8dIk,2129
|
|
63
63
|
onnxtr/utils/visualization.py,sha256=CX09qvDnNIw3BFW5F3jM4R9OcpLWAeZyoDyTAOGRvls,9925
|
|
64
64
|
onnxtr/utils/vocabs.py,sha256=SCQ4XQjbHSxunj1tg2iHRiPfE8OaTAMhcJbKq5BNvFs,3138
|
|
65
|
-
onnxtr-0.1.
|
|
66
|
-
onnxtr-0.1.
|
|
67
|
-
onnxtr-0.1.
|
|
68
|
-
onnxtr-0.1.
|
|
69
|
-
onnxtr-0.1.
|
|
70
|
-
onnxtr-0.1.
|
|
65
|
+
onnxtr-0.1.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
66
|
+
onnxtr-0.1.2.dist-info/METADATA,sha256=hg64djJ-sUVObh4t9QYB3PJSjZgYxrPne2aS_lEtWcI,25645
|
|
67
|
+
onnxtr-0.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
68
|
+
onnxtr-0.1.2.dist-info/top_level.txt,sha256=48aR9EH095hmgye7CNuxAW3o_cj4TjhWmuw3jEMdTs0,12
|
|
69
|
+
onnxtr-0.1.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
70
|
+
onnxtr-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|