onnxtr 0.4.0__py3-none-any.whl → 0.4.1__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.
@@ -112,8 +112,8 @@ class _OCRPredictor:
112
112
  ]
113
113
  )
114
114
  return [
115
- # We exapnd if the page is wider than tall and the angle is 90 or -90
116
- rotate_image(page, angle, expand=page.shape[1] > page.shape[0] and abs(angle) == 90)
115
+ # expand if height and width are not equal
116
+ rotate_image(page, angle, expand=page.shape[0] != page.shape[1])
117
117
  for page, angle in zip(pages, origin_pages_orientations)
118
118
  ]
119
119
 
@@ -100,6 +100,8 @@ class OCRPredictor(NestedObject, _OCRPredictor):
100
100
  origin_pages_orientations = None
101
101
  if self.straighten_pages:
102
102
  pages = self._straighten_pages(pages, seg_maps, general_pages_orientations, origin_pages_orientations)
103
+ # update page shapes after straightening
104
+ origin_page_shapes = [page.shape[:2] for page in pages]
103
105
 
104
106
  # forward again to get predictions on straight pages
105
107
  loc_preds = self.det_predictor(pages, **kwargs) # type: ignore[assignment]
onnxtr/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = 'v0.4.0'
1
+ __version__ = 'v0.4.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: onnxtr
3
- Version: 0.4.0
3
+ Version: 0.4.1
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
@@ -225,7 +225,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
225
225
  Requires-Python: <4,>=3.9.0
226
226
  Description-Content-Type: text/markdown
227
227
  License-File: LICENSE
228
- Requires-Dist: numpy<2.0.0,>=1.16.0
228
+ Requires-Dist: numpy<3.0.0,>=1.16.0
229
229
  Requires-Dist: scipy<2.0.0,>=1.4.0
230
230
  Requires-Dist: opencv-python<5.0.0,>=4.5.0
231
231
  Requires-Dist: pypdfium2<5.0.0,>=4.11.0
@@ -276,7 +276,7 @@ Requires-Dist: mplcursors>=0.3; extra == "viz"
276
276
  [![codecov](https://codecov.io/gh/felixdittrich92/OnnxTR/graph/badge.svg?token=WVFRCQBOLI)](https://codecov.io/gh/felixdittrich92/OnnxTR)
277
277
  [![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)
278
278
  [![CodeFactor](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr/badge)](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr)
279
- [![Pypi](https://img.shields.io/badge/pypi-v0.3.2-blue.svg)](https://pypi.org/project/OnnxTR/)
279
+ [![Pypi](https://img.shields.io/badge/pypi-v0.4.1-blue.svg)](https://pypi.org/project/OnnxTR/)
280
280
 
281
281
  > :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
282
 
@@ -589,8 +589,8 @@ The smallest combination in OnnxTR (docTR) of `db_mobilenet_v3_large` and `crnn_
589
589
  |Library |FUNSD (199 pages) |CORD (900 pages) |
590
590
  |---------------------------------|-------------------------------|-------------------------------|
591
591
  |docTR (CPU) - v0.8.1 | ~1.29s / Page | ~0.60s / Page |
592
- |**OnnxTR (CPU)** - v0.1.2 | ~0.57s / Page | **~0.25s / Page** |
593
- |**OnnxTR (CPU) 8-bit** - v0.1.2 | **~0.38s / Page** | **~0.14s / Page** |
592
+ |**OnnxTR (CPU)** - v0.4.1 | ~0.57s / Page | **~0.25s / Page** |
593
+ |**OnnxTR (CPU) 8-bit** - v0.4.1 | **~0.38s / Page** | **~0.14s / Page** |
594
594
  |EasyOCR (CPU) - v1.7.1 | ~1.96s / Page | ~1.75s / Page |
595
595
  |**PyTesseract (CPU)** - v0.3.10 | **~0.50s / Page** | ~0.52s / Page |
596
596
  |Surya (line) (CPU) - v0.4.4 | ~48.76s / Page | ~35.49s / Page |
@@ -602,7 +602,7 @@ The smallest combination in OnnxTR (docTR) of `db_mobilenet_v3_large` and `crnn_
602
602
  |-------------------------------------|-------------------------------|-------------------------------|
603
603
  |docTR (GPU) - v0.8.1 | ~0.07s / Page | ~0.05s / Page |
604
604
  |**docTR (GPU) float16** - v0.8.1 | **~0.06s / Page** | **~0.03s / Page** |
605
- |OnnxTR (GPU) - v0.1.2 | **~0.06s / Page** | ~0.04s / Page |
605
+ |OnnxTR (GPU) - v0.4.1 | **~0.06s / Page** | ~0.04s / Page |
606
606
  |EasyOCR (GPU) - v1.7.1 | ~0.31s / Page | ~0.19s / Page |
607
607
  |Surya (GPU) float16 - v0.4.4 | ~3.70s / Page | ~2.81s / Page |
608
608
  |**PaddleOCR (GPU) - no cls - v2.7.3**| ~0.08s / Page | **~0.03s / Page** |
@@ -621,6 +621,16 @@ If you wish to cite please refer to the base project citation, feel free to use
621
621
  }
622
622
  ```
623
623
 
624
+ ```bibtex
625
+ @misc{onnxtr2024,
626
+ title={OnnxTR: Optical Character Recognition made seamless & accessible to anyone, powered by Onnx},
627
+ author={Felix Dittrich},
628
+ year={2024},
629
+ publisher = {GitHub},
630
+ howpublished = {\url{https://github.com/felixdittrich92/OnnxTR}}
631
+ }
632
+ ```
633
+
624
634
  ## License
625
635
 
626
636
  Distributed under the Apache 2.0 License. See [`LICENSE`](https://github.com/felixdittrich92/OnnxTR?tab=Apache-2.0-1-ov-file#readme) for more information.
@@ -1,7 +1,7 @@
1
1
  onnxtr/__init__.py,sha256=h7Wc2tuHLsaoCk5xNpEFEK-g11A6SJA7nAasA76TQ_Y,100
2
2
  onnxtr/file_utils.py,sha256=WjUKalEdR53aoeIY4e-ihy3r7J_C9qFxL40JHGPfutc,1107
3
3
  onnxtr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- onnxtr/version.py,sha256=mlQjqZ2nsBZtkuFOkuGFM9GBJm0QS3NcUEzYSoHTEfs,23
4
+ onnxtr/version.py,sha256=FMLDI1-41V4TL8AtTJYDQPs1_pJ9uac4WXnI9j16CjY,23
5
5
  onnxtr/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  onnxtr/contrib/artefacts.py,sha256=tdmfhvfXVRYEH7uj4_hqf2cuUGoTieyNK8bXsD3zHwo,5383
7
7
  onnxtr/contrib/base.py,sha256=KyJ8_zDSKEWSFBszgCbLjEeI7SKg4N_iH_ZQNf90SWQ,3288
@@ -38,8 +38,8 @@ onnxtr/models/detection/predictor/base.py,sha256=bt8M6I14tWC9DYjrFrqg-AU5u670_uP
38
38
  onnxtr/models/factory/__init__.py,sha256=cKPoH2V2157lLMTR2zsljG3_IQHziodqR-XK_LG0D_I,19
39
39
  onnxtr/models/factory/hub.py,sha256=Fk6pX9VJD422rnVgLh37o136T_0YAsQFzY2dQplDfa4,7176
40
40
  onnxtr/models/predictor/__init__.py,sha256=XL25XkRkgyK7mldF-CWhg2MMakSdP5vLpDLwL59hphk,25
41
- onnxtr/models/predictor/base.py,sha256=VUs1OIsb8FW91U1ehB1sBaxG4Suz8iS-Ut50Zt6_SHo,8860
42
- onnxtr/models/predictor/predictor.py,sha256=etxgAvT8cYhboPyHiDRO0BL1rBoTw5lL1vhZP4dHWqw,6247
41
+ onnxtr/models/predictor/base.py,sha256=ZutI4iNUWk5I5wFfzip89JEDl0SmN7W7hCWRmVec38w,8813
42
+ onnxtr/models/predictor/predictor.py,sha256=pfyTu2qidlPOpXyNKkh20cZefWYUZlF3VEmzrsQr2K8,6368
43
43
  onnxtr/models/preprocessor/__init__.py,sha256=ERmmOxz_9mUkIuccNbzUa5Y6gVLLVDdyc4cCxbCCUbY,20
44
44
  onnxtr/models/preprocessor/base.py,sha256=8ZCKsB-o9uRaUm0x4x9FYpYxLXpwHyq2nVv_TlRgaMw,3990
45
45
  onnxtr/models/recognition/__init__.py,sha256=h1bZs55iLJBMATtzS4ntTKwfD6OGXBiiqGv_hEnOFnE,41
@@ -67,9 +67,9 @@ onnxtr/utils/reconstitution.py,sha256=Hx1_ddLevKLzuxXc19UelPdsGlAwqi4f6vRSYKHDUB
67
67
  onnxtr/utils/repr.py,sha256=kfbjGL6KymGT8spo2UL4FJXZ0XRwa7CO7Y1dTVR8dIk,2129
68
68
  onnxtr/utils/visualization.py,sha256=CX09qvDnNIw3BFW5F3jM4R9OcpLWAeZyoDyTAOGRvls,9925
69
69
  onnxtr/utils/vocabs.py,sha256=9Ufmjf7OczWb0931NjWTL7owXLYOKn5x0ulaoVeJGn8,3855
70
- onnxtr-0.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
- onnxtr-0.4.0.dist-info/METADATA,sha256=3mMbArBMh3QlJLH0-DrxblNbzy-WvPwQJ9CApSyq0z8,31442
72
- onnxtr-0.4.0.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
73
- onnxtr-0.4.0.dist-info/top_level.txt,sha256=r_MSUTpspp4pWEEWvly-s7ZkfCg1KwrK6-kBlXkWKU8,7
74
- onnxtr-0.4.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
75
- onnxtr-0.4.0.dist-info/RECORD,,
70
+ onnxtr-0.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
+ onnxtr-0.4.1.dist-info/METADATA,sha256=ghYrvvMe49613vZHcXr8qw6e8o7aoVD4uocdcKDaRYU,31723
72
+ onnxtr-0.4.1.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
73
+ onnxtr-0.4.1.dist-info/top_level.txt,sha256=r_MSUTpspp4pWEEWvly-s7ZkfCg1KwrK6-kBlXkWKU8,7
74
+ onnxtr-0.4.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
75
+ onnxtr-0.4.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5