onnxtr 0.1.0__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 CHANGED
@@ -1 +1 @@
1
- __version__ = 'v0.1.0'
1
+ __version__ = 'v0.1.2'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: onnxtr
3
- Version: 0.1.0
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,8 +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
- Requires-Dist: onnxruntime >=1.11.0
232
230
  Requires-Dist: opencv-python <5.0.0,>=4.5.0
233
231
  Requires-Dist: pypdfium2 <5.0.0,>=4.0.0
234
232
  Requires-Dist: pyclipper <2.0.0,>=1.2.0
@@ -239,7 +237,10 @@ Requires-Dist: Pillow >=9.2.0
239
237
  Requires-Dist: defusedxml >=0.7.0
240
238
  Requires-Dist: anyascii >=0.3.2
241
239
  Requires-Dist: tqdm >=4.30.0
240
+ Provides-Extra: cpu
241
+ Requires-Dist: onnxruntime >=1.11.0 ; extra == 'cpu'
242
242
  Provides-Extra: dev
243
+ Requires-Dist: onnxruntime >=1.11.0 ; extra == 'dev'
243
244
  Requires-Dist: weasyprint >=55.0 ; extra == 'dev'
244
245
  Requires-Dist: matplotlib >=3.1.0 ; extra == 'dev'
245
246
  Requires-Dist: mplcursors >=0.3 ; extra == 'dev'
@@ -274,9 +275,9 @@ Requires-Dist: mplcursors >=0.3 ; extra == 'viz'
274
275
  [![codecov](https://codecov.io/gh/felixdittrich92/OnnxTR/graph/badge.svg?token=WVFRCQBOLI)](https://codecov.io/gh/felixdittrich92/OnnxTR)
275
276
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4fff4d764bb14fb8b4f4afeb9587231b)](https://app.codacy.com/gh/felixdittrich92/OnnxTR/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
276
277
  [![CodeFactor](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr/badge)](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr)
277
- [![Pypi](https://img.shields.io/badge/pypi-v0.0.1-blue.svg)](https://pypi.org/project/OnnxTR/)
278
+ [![Pypi](https://img.shields.io/badge/pypi-v0.1.1-blue.svg)](https://pypi.org/project/OnnxTR/)
278
279
 
279
- > :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.
280
281
 
281
282
  **Optical Character Recognition made seamless & accessible to anyone, powered by Onnx**
282
283
 
@@ -298,18 +299,22 @@ Python 3.9 (or higher) and [pip](https://pip.pypa.io/en/stable/) are required to
298
299
 
299
300
  You can then install the latest release of the package using [pypi](https://pypi.org/project/OnnxTR/) as follows:
300
301
 
301
- **NOTE:** For GPU support please take a look at: [ONNX Runtime](https://onnxruntime.ai/getting-started). Currently supported execution providers by default are: CPU, CUDA
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).
302
307
 
303
308
  ```shell
304
- pip install OnnxTR
309
+ pip install "onnxtr[cpu]"
305
310
  # with gpu support
306
- pip install "OnnxTR[gpu]"
311
+ pip install "onnxtr[gpu]"
307
312
  # with HTML support
308
- pip install "OnnxTR[html]"
313
+ pip install "onnxtr[html]"
309
314
  # with support for visualization
310
- pip install "OnnxTR[viz]"
315
+ pip install "onnxtr[viz]"
311
316
  # with support for all dependencies
312
- pip install "OnnxTR[html, gpu, viz]"
317
+ pip install "onnxtr[html, gpu, viz]"
313
318
  ```
314
319
 
315
320
  ### Reading files
@@ -338,13 +343,17 @@ from onnxtr.models import ocr_predictor
338
343
 
339
344
  model = ocr_predictor(
340
345
  det_arch='fast_base', # detection architecture
341
- rec_arch='vitstr_base', # recognition architecture
346
+ reco_arch='vitstr_base', # recognition architecture
342
347
  det_bs=4, # detection batch size
343
348
  reco_bs=1024, # recognition batch size
344
349
  assume_straight_pages=True, # set to `False` if the pages are not straight (rotation, perspective, etc.) (default: True)
345
350
  straighten_pages=False, # set to `True` if the pages should be straightened before final processing (default: False)
351
+ # Preprocessing related parameters
346
352
  preserve_aspect_ratio=True, # set to `False` if the aspect ratio should not be preserved (default: True)
347
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)
348
357
  # DocumentBuilder specific parameters
349
358
  resolve_lines=True, # whether words should be automatically grouped into lines (default: True)
350
359
  resolve_blocks=True, # whether lines should be automatically grouped into blocks (default: True)
@@ -396,7 +405,7 @@ from onnxtr.models import ocr_predictor, linknet_resnet18, parseq
396
405
 
397
406
  reco_model = parseq("path_to_custom_model.onnx", vocab="ABC")
398
407
  det_model = linknet_resnet18("path_to_custom_model.onnx")
399
- model = ocr_predictor(det_model=det_model, reco_model=reco_model)
408
+ model = ocr_predictor(det_arch=det_model, reco_arch=reco_model)
400
409
  ```
401
410
 
402
411
  ## Models architectures
@@ -460,7 +469,14 @@ NOTE:
460
469
 
461
470
  ### Benchmarks
462
471
 
463
- COMING SOON
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 |
464
480
 
465
481
  ## Citation
466
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=wC2oqFtrOUdONUyrZY5FqyMyRDiF3ryABp7mW73C87o,23
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.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
- onnxtr-0.1.0.dist-info/METADATA,sha256=k4DicngL3zLNaAWV2yRaF82MbJ6XdpAh9D3X0OWBS3Y,24645
67
- onnxtr-0.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
- onnxtr-0.1.0.dist-info/top_level.txt,sha256=48aR9EH095hmgye7CNuxAW3o_cj4TjhWmuw3jEMdTs0,12
69
- onnxtr-0.1.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
70
- onnxtr-0.1.0.dist-info/RECORD,,
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