magic-pdf 1.3.7__py3-none-any.whl → 1.3.8__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.
magic_pdf/libs/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.3.7"
1
+ __version__ = "1.3.8"
@@ -55,7 +55,8 @@ class PytorchPaddleOCR(TextSystem):
55
55
  self.lang = kwargs.get('lang', 'ch')
56
56
 
57
57
  device = get_device()
58
- if device == 'cpu' and self.lang == 'ch':
58
+ if device == 'cpu' and self.lang in ['ch', 'ch_server']:
59
+ logger.warning("The current device in use is CPU. To ensure the speed of parsing, the language is automatically switched to ch_lite.")
59
60
  self.lang = 'ch_lite'
60
61
 
61
62
  if self.lang in latin_lang:
@@ -79,7 +80,7 @@ class PytorchPaddleOCR(TextSystem):
79
80
  kwargs['rec_char_dict_path'] = os.path.join(root_dir, 'pytorchocr', 'utils', 'resources', 'dict', dict_file)
80
81
  # kwargs['rec_batch_num'] = 8
81
82
 
82
- kwargs['device'] = get_device()
83
+ kwargs['device'] = device
83
84
 
84
85
  default_args = vars(args)
85
86
  default_args.update(kwargs)
@@ -171,6 +171,31 @@ ch_PP-OCRv4_rec_server_infer:
171
171
  nrtr_dim: 384
172
172
  max_text_length: 25
173
173
 
174
+ ch_PP-OCRv4_rec_server_doc_infer:
175
+ model_type: rec
176
+ algorithm: SVTR_HGNet
177
+ Transform:
178
+ Backbone:
179
+ name: PPHGNet_small
180
+ Head:
181
+ name: MultiHead
182
+ out_channels_list:
183
+ CTCLabelDecode: 15631
184
+ head_list:
185
+ - CTCHead:
186
+ Neck:
187
+ name: svtr
188
+ dims: 120
189
+ depth: 2
190
+ hidden_dims: 120
191
+ kernel_size: [ 1, 3 ]
192
+ use_guide: True
193
+ Head:
194
+ fc_decay: 0.00001
195
+ - NRTRHead:
196
+ nrtr_dim: 384
197
+ max_text_length: 25
198
+
174
199
  chinese_cht_PP-OCRv3_rec_infer:
175
200
  model_type: rec
176
201
  algorithm: SVTR