deepdoctection 0.39.3__py3-none-any.whl → 0.39.4__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.

Potentially problematic release.


This version of deepdoctection might be problematic. Click here for more details.

@@ -25,7 +25,7 @@ from .utils.logger import LoggingRecord, logger
25
25
 
26
26
  # pylint: enable=wrong-import-position
27
27
 
28
- __version__ = "0.39.3"
28
+ __version__ = "0.39.4"
29
29
 
30
30
  _IMPORT_STRUCTURE = {
31
31
  "analyzer": ["config_sanity_checks", "get_dd_analyzer", "ServiceFactory"],
@@ -79,8 +79,8 @@ def _load_model(
79
79
  state_dict = torch.load(os.fspath(path_weights), map_location=device)
80
80
  for key in list(state_dict.keys()):
81
81
  state_dict["model." + key] = state_dict.pop(key)
82
- doctr_predictor.load_state_dict(state_dict)
83
- doctr_predictor.to(device)
82
+ doctr_predictor.load_state_dict(state_dict) # type: ignore
83
+ doctr_predictor.to(device) # type: ignore
84
84
  elif lib == "TF":
85
85
  # Unzip the archive
86
86
  params_path = Path(path_weights).parent
@@ -88,9 +88,9 @@ def _load_model(
88
88
  if is_zip_path:
89
89
  with ZipFile(path_weights, "r") as file:
90
90
  file.extractall(path=params_path)
91
- doctr_predictor.model.load_weights(params_path / "weights")
91
+ doctr_predictor.model.load_weights(params_path / "weights") # type: ignore
92
92
  else:
93
- doctr_predictor.model.load_weights(os.fspath(path_weights))
93
+ doctr_predictor.model.load_weights(os.fspath(path_weights)) # type: ignore
94
94
 
95
95
 
96
96
  def auto_select_lib_for_doctr() -> Literal["PT", "TF"]:
@@ -125,7 +125,7 @@ def doctr_predict_text_lines(
125
125
  DetectionResult(
126
126
  box=box[:4].tolist(), class_id=1, score=box[4], absolute_coords=False, class_name=LayoutType.WORD
127
127
  )
128
- for box in raw_output[0]["words"]
128
+ for box in raw_output[0]["words"] # type: ignore
129
129
  ]
130
130
  return detection_results
131
131
 
@@ -480,7 +480,7 @@ class DoctrTextRecognizer(TextRecognizer):
480
480
  return auto_select_lib_for_doctr()
481
481
 
482
482
  def clear_model(self) -> None:
483
- self.doctr_predictor = None
483
+ self.doctr_predictor = None # type: ignore
484
484
 
485
485
 
486
486
  class DocTrRotationTransformer(ImageTransformer):
@@ -527,7 +527,8 @@ class DocTrRotationTransformer(ImageTransformer):
527
527
  return viz_handler.rotate_image(np_img, specification.angle) # type: ignore
528
528
 
529
529
  def predict(self, np_img: PixelValues) -> DetectionResult:
530
- angle = estimate_orientation(np_img, self.number_contours, self.ratio_threshold_for_lines)
530
+ angle = estimate_orientation(np_img, n_ct=self.number_contours,
531
+ ratio_threshold_for_lines=self.ratio_threshold_for_lines)
531
532
  if angle < 0:
532
533
  angle += 360
533
534
  return DetectionResult(angle=round(angle, 2))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: deepdoctection
3
- Version: 0.39.3
3
+ Version: 0.39.4
4
4
  Summary: Repository for Document AI
5
5
  Home-page: https://github.com/deepdoctection/deepdoctection
6
6
  Author: Dr. Janis Meyer
@@ -57,7 +57,7 @@ Requires-Dist: tensorpack==0.11; extra == "tf"
57
57
  Requires-Dist: protobuf==3.20.1; extra == "tf"
58
58
  Requires-Dist: tensorflow-addons>=0.17.1; extra == "tf"
59
59
  Requires-Dist: tf2onnx>=1.9.2; extra == "tf"
60
- Requires-Dist: python-doctr==0.8.1; extra == "tf"
60
+ Requires-Dist: python-doctr==0.9.0; extra == "tf"
61
61
  Requires-Dist: pycocotools>=2.0.2; extra == "tf"
62
62
  Requires-Dist: boto3==1.34.102; extra == "tf"
63
63
  Requires-Dist: pdfplumber>=0.11.0; extra == "tf"
@@ -88,7 +88,7 @@ Requires-Dist: tqdm==4.64.0; extra == "pt"
88
88
  Requires-Dist: timm>=0.9.16; extra == "pt"
89
89
  Requires-Dist: transformers>=4.48.0; extra == "pt"
90
90
  Requires-Dist: accelerate>=0.29.1; extra == "pt"
91
- Requires-Dist: python-doctr==0.8.1; extra == "pt"
91
+ Requires-Dist: python-doctr==0.9.0; extra == "pt"
92
92
  Requires-Dist: boto3==1.34.102; extra == "pt"
93
93
  Requires-Dist: pdfplumber>=0.11.0; extra == "pt"
94
94
  Requires-Dist: fasttext-wheel; extra == "pt"
@@ -1,4 +1,4 @@
1
- deepdoctection/__init__.py,sha256=ESGz9jn4mQi0T_Il2gIS6CArPLUrfANzgIQLHwyw8eE,12754
1
+ deepdoctection/__init__.py,sha256=4u3rGxdbvfFr1l6xzH6qO5MapLGspBv5XPhBGMeji_4,12754
2
2
  deepdoctection/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  deepdoctection/analyzer/__init__.py,sha256=icClxrd20XutD6LxLgEPIWceSs4j_QfI3szCE-9BL2w,729
4
4
  deepdoctection/analyzer/_config.py,sha256=1rfvVrp7cI2YLzpahD77aa1tZ_KFAIQ21DM1NWhxYiI,5058
@@ -53,7 +53,7 @@ deepdoctection/extern/__init__.py,sha256=9Iks9b4Q_LynjcV167TVCoK8YsQRUcA2jjmAmDN
53
53
  deepdoctection/extern/base.py,sha256=ONPgappl_P5HSwQr42FatuRnwMTvUPecPsCztDTN0Hw,24108
54
54
  deepdoctection/extern/d2detect.py,sha256=zrKv1yurApnjD7QZIZk_8LYCahjmN82MQUjHjv8zvkQ,22127
55
55
  deepdoctection/extern/deskew.py,sha256=sPoixu8S9he-0wbs-jgxtPE2V9BiP4-3uZlb6F5Y1SA,3077
56
- deepdoctection/extern/doctrocr.py,sha256=T3_tvlih22_dVCBZypS1Y8tjQQB1fkAxIbGdUGHIapQ,24473
56
+ deepdoctection/extern/doctrocr.py,sha256=WrFA0N54fr9C_ahGzZJb4H-fNzz5wXQFveFiERYAm74,24637
57
57
  deepdoctection/extern/fastlang.py,sha256=F4gK-SEwcCujjxH327ZDzMGWToJ49xS_dCKcePQ9IlY,4780
58
58
  deepdoctection/extern/hfdetr.py,sha256=JzHrrTyzS9qh6T2TsvKboAGZkIhno2txmSoLQ5Vd-lo,12077
59
59
  deepdoctection/extern/hflayoutlm.py,sha256=tFaf90FRbZzhSycdp8rGkeiPywQa6UcTEEwbayIXkr0,57023
@@ -141,8 +141,8 @@ deepdoctection/utils/transform.py,sha256=3kCgsEeRkG1efCdkfvj7tUFMs-e2jbjbflq826F
141
141
  deepdoctection/utils/types.py,sha256=_3dmPdCIZNLbgU5QP5k_c5phDf18xLe1kYL6t2nM45s,2953
142
142
  deepdoctection/utils/utils.py,sha256=csVs_VvCq4QBETPoE2JdTTL4MFYnD4xh-Js5vRb612g,6492
143
143
  deepdoctection/utils/viz.py,sha256=Jf8ePNYWlpuyaS6SeTYQ4OyA3eNhtgjvAQZnGNdgHC0,27051
144
- deepdoctection-0.39.3.dist-info/LICENSE,sha256=GQ0rUvuGdrMNEI3iHK5UQx6dIMU1QwAuyXsxUHn5MEQ,11351
145
- deepdoctection-0.39.3.dist-info/METADATA,sha256=CCHsl3E3U1slBqAfbxiGChEDfDH8rJRRGmLhz56LuLc,19741
146
- deepdoctection-0.39.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
147
- deepdoctection-0.39.3.dist-info/top_level.txt,sha256=hs2DdoOL9h4mnHhmO82BT4pz4QATIoOZ20PZmlnxFI8,15
148
- deepdoctection-0.39.3.dist-info/RECORD,,
144
+ deepdoctection-0.39.4.dist-info/LICENSE,sha256=GQ0rUvuGdrMNEI3iHK5UQx6dIMU1QwAuyXsxUHn5MEQ,11351
145
+ deepdoctection-0.39.4.dist-info/METADATA,sha256=9DvyyvO9Ofd9YFuqQ2SVO2Bi69WayBC2VZyrpMCimZQ,19741
146
+ deepdoctection-0.39.4.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
147
+ deepdoctection-0.39.4.dist-info/top_level.txt,sha256=hs2DdoOL9h4mnHhmO82BT4pz4QATIoOZ20PZmlnxFI8,15
148
+ deepdoctection-0.39.4.dist-info/RECORD,,