magic-pdf 0.9.1__py3-none-any.whl → 0.9.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.
- magic_pdf/libs/version.py +1 -1
- magic_pdf/model/pdf_extract_kit.py +0 -13
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/METADATA +28 -24
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/RECORD +8 -8
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/LICENSE.md +0 -0
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/WHEEL +0 -0
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/entry_points.txt +0 -0
- {magic_pdf-0.9.1.dist-info → magic_pdf-0.9.2.dist-info}/top_level.txt +0 -0
magic_pdf/libs/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.9.
|
1
|
+
__version__ = "0.9.2"
|
@@ -282,8 +282,6 @@ class CustomPEKModel:
|
|
282
282
|
)
|
283
283
|
# 初始化ocr
|
284
284
|
if self.apply_ocr:
|
285
|
-
|
286
|
-
# self.ocr_model = ModifiedPaddleOCR(show_log=show_log, det_db_box_thresh=0.3)
|
287
285
|
self.ocr_model = atom_model_manager.get_atom_model(
|
288
286
|
atom_model_name=AtomicModel.OCR,
|
289
287
|
ocr_show_log=show_log,
|
@@ -301,17 +299,6 @@ class CustomPEKModel:
|
|
301
299
|
device=self.device
|
302
300
|
)
|
303
301
|
|
304
|
-
home_directory = Path.home()
|
305
|
-
det_source = os.path.join(models_dir, table_model_dir, DETECT_MODEL_DIR)
|
306
|
-
rec_source = os.path.join(models_dir, table_model_dir, REC_MODEL_DIR)
|
307
|
-
det_dest_dir = os.path.join(home_directory, PP_DET_DIRECTORY)
|
308
|
-
rec_dest_dir = os.path.join(home_directory, PP_REC_DIRECTORY)
|
309
|
-
|
310
|
-
if not os.path.exists(det_dest_dir):
|
311
|
-
shutil.copytree(det_source, det_dest_dir)
|
312
|
-
if not os.path.exists(rec_dest_dir):
|
313
|
-
shutil.copytree(rec_source, rec_dest_dir)
|
314
|
-
|
315
302
|
logger.info('DocAnalysis init done!')
|
316
303
|
|
317
304
|
def __call__(self, image):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: magic-pdf
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.2
|
4
4
|
Summary: A practical tool for converting PDF to Markdown
|
5
5
|
Home-page: https://github.com/opendatalab/MinerU
|
6
6
|
Requires-Python: >=3.9
|
@@ -80,7 +80,7 @@ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_sy
|
|
80
80
|
</div>
|
81
81
|
|
82
82
|
# Changelog
|
83
|
-
- 2024/11/06 0.9.
|
83
|
+
- 2024/11/06 0.9.2 released. Integrated the [StructTable-InternVL2-1B](https://huggingface.co/U4R/StructTable-InternVL2-1B) model for table recognition functionality.
|
84
84
|
- 2024/10/31 0.9.0 released. This is a major new version with extensive code refactoring, addressing numerous issues, improving performance, reducing hardware requirements, and enhancing usability:
|
85
85
|
- Refactored the sorting module code to use [layoutreader](https://github.com/ppaanngggg/layoutreader) for reading order sorting, ensuring high accuracy in various layouts.
|
86
86
|
- Refactored the paragraph concatenation module to achieve good results in cross-column, cross-page, cross-figure, and cross-table scenarios.
|
@@ -176,13 +176,14 @@ There are three different ways to experience MinerU:
|
|
176
176
|
- [Quick CPU Demo (Windows, Linux, Mac)](#quick-cpu-demo)
|
177
177
|
- [Linux/Windows + CUDA](#Using-GPU)
|
178
178
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
179
|
+
> [!WARNING]
|
180
|
+
> **Pre-installation Notice—Hardware and Software Environment Support**
|
181
|
+
>
|
182
|
+
> To ensure the stability and reliability of the project, we only optimize and test for specific hardware and software environments during development. This ensures that users deploying and running the project on recommended system configurations will get the best performance with the fewest compatibility issues.
|
183
|
+
>
|
184
|
+
> By focusing resources on the mainline environment, our team can more efficiently resolve potential bugs and develop new features.
|
185
|
+
>
|
186
|
+
> In non-mainline environments, due to the diversity of hardware and software configurations, as well as third-party dependency compatibility issues, we cannot guarantee 100% project availability. Therefore, for users who wish to use this project in non-recommended environments, we suggest carefully reading the documentation and FAQ first. Most issues already have corresponding solutions in the FAQ. We also encourage community feedback to help us gradually expand support.
|
186
187
|
|
187
188
|
<table>
|
188
189
|
<tr>
|
@@ -262,11 +263,13 @@ Refer to [How to Download Model Files](docs/how_to_download_models_en.md) for de
|
|
262
263
|
After completing the [2. Download model weight files](#2-download-model-weight-files) step, the script will automatically generate a `magic-pdf.json` file in the user directory and configure the default model path.
|
263
264
|
You can find the `magic-pdf.json` file in your 【user directory】.
|
264
265
|
|
266
|
+
> [!TIP]
|
265
267
|
> The user directory for Windows is "C:\\Users\\username", for Linux it is "/home/username", and for macOS it is "/Users/username".
|
266
268
|
|
267
269
|
You can modify certain configurations in this file to enable or disable features, such as table recognition:
|
268
270
|
|
269
271
|
|
272
|
+
> [!NOTE]
|
270
273
|
> If the following items are not present in the JSON, please manually add the required items and remove the comment content (standard JSON does not support comments).
|
271
274
|
|
272
275
|
```json
|
@@ -295,13 +298,14 @@ If your device supports CUDA and meets the GPU requirements of the mainline envi
|
|
295
298
|
- [Ubuntu 22.04 LTS + GPU](docs/README_Ubuntu_CUDA_Acceleration_en_US.md)
|
296
299
|
- [Windows 10/11 + GPU](docs/README_Windows_CUDA_Acceleration_en_US.md)
|
297
300
|
- Quick Deployment with Docker
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
301
|
+
> [!IMPORTANT]
|
302
|
+
> Docker requires a GPU with at least 16GB of VRAM, and all acceleration features are enabled by default.
|
303
|
+
>
|
304
|
+
> Before running this Docker, you can use the following command to check if your device supports CUDA acceleration on Docker.
|
305
|
+
>
|
306
|
+
> ```bash
|
307
|
+
> docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi
|
308
|
+
> ```
|
305
309
|
```bash
|
306
310
|
wget https://github.com/opendatalab/MinerU/raw/master/Dockerfile
|
307
311
|
docker build -t mineru:latest .
|
@@ -363,8 +367,8 @@ The results will be saved in the `{some_output_dir}` directory. The output file
|
|
363
367
|
├── some_pdf_spans.pdf # smallest granularity bbox position information diagram
|
364
368
|
└── some_pdf_content_list.json # Rich text JSON arranged in reading order
|
365
369
|
```
|
366
|
-
|
367
|
-
For more information about the output files, please refer to the [Output File Description](docs/output_file_en_us.md).
|
370
|
+
> [!TIP]
|
371
|
+
> For more information about the output files, please refer to the [Output File Description](docs/output_file_en_us.md).
|
368
372
|
|
369
373
|
### API
|
370
374
|
|
@@ -415,12 +419,12 @@ TODO
|
|
415
419
|
|
416
420
|
# TODO
|
417
421
|
|
418
|
-
-
|
419
|
-
-
|
420
|
-
-
|
421
|
-
-
|
422
|
-
-
|
423
|
-
-
|
422
|
+
- [x] Reading order based on the model
|
423
|
+
- [x] Recognition of `index` and `list` in the main text
|
424
|
+
- [x] Table recognition
|
425
|
+
- [ ] Code block recognition in the main text
|
426
|
+
- [ ] [Chemical formula recognition](docs/chemical_knowledge_introduction/introduction.pdf)
|
427
|
+
- [ ] Geometric shape recognition
|
424
428
|
|
425
429
|
# Known Issues
|
426
430
|
|
@@ -65,13 +65,13 @@ magic_pdf/libs/pdf_check.py,sha256=MAe8wzwT0qvPf_I72wEZG7k1g4haNHS7oUtLqkB5rlE,2
|
|
65
65
|
magic_pdf/libs/pdf_image_tools.py,sha256=CAd01giTKr_UJz1_QtDOARG9G9z69GFpzRZwcWSfLtE,1282
|
66
66
|
magic_pdf/libs/safe_filename.py,sha256=ckwcM_eqoysTb5id8czp-tXq2G9da0-l3pshZDCHQtE,236
|
67
67
|
magic_pdf/libs/textbase.py,sha256=SC1Frhz3Fb7V7n2SFRBsl7Bmg0JZdlvZskq0lfW1vIk,732
|
68
|
-
magic_pdf/libs/version.py,sha256=
|
68
|
+
magic_pdf/libs/version.py,sha256=gqT-BGoeEItda9fICQDvLbxEjWRIBhFJxPxxKvmHLUo,22
|
69
69
|
magic_pdf/libs/vis_utils.py,sha256=hTOTEakKV0pGMbk0tbRkVI_tku7A3dGc96ynObZ4kwI,10207
|
70
70
|
magic_pdf/model/__init__.py,sha256=1QcfMKET0xQhSaZMjNQHi_TjzSSDR6PI5mjkmaXHPe8,52
|
71
71
|
magic_pdf/model/doc_analyze_by_custom_model.py,sha256=eYrtOIlFqw8O95ShoCTaAhLBHk7TXc5DGif93VikW4s,6977
|
72
72
|
magic_pdf/model/magic_model.py,sha256=RKJOruUGAV1lHcGqSlCDbkJn5kutb3fphDreOHASPQg,43505
|
73
73
|
magic_pdf/model/model_list.py,sha256=tJ9jtMB93HGx8Rmt8wmQSDFXZBUIPQrwaaYsep4luTM,183
|
74
|
-
magic_pdf/model/pdf_extract_kit.py,sha256=
|
74
|
+
magic_pdf/model/pdf_extract_kit.py,sha256=9pdtcQgwn-XMvyQ7yMfzqKgjPfxEuNXR7juCPx-OM-M,20929
|
75
75
|
magic_pdf/model/ppTableModel.py,sha256=fqMuMahN2BW4sKGCgFLsi1X1OFaIG8Dab_eHUhKPcH4,2692
|
76
76
|
magic_pdf/model/pp_structure_v2.py,sha256=BKPN7W4BjG0eWPAPjPEac1RMnb5eIzmAz4E4Rq-9b1U,3019
|
77
77
|
magic_pdf/model/pek_sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -170,9 +170,9 @@ magic_pdf/tools/cli_dev.py,sha256=3e5eyCQEt_EujXZu5fUAWr_W-YQQVqS9pB0Qgw7t1D8,41
|
|
170
170
|
magic_pdf/tools/common.py,sha256=2S8N60pcA6bFqAmdchoEmn22l9ntQxEfyaKpxfCKJ-Y,5465
|
171
171
|
magic_pdf/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
172
172
|
magic_pdf/utils/annotations.py,sha256=82ou3uELNbQWa9hOFFkVt0gsIskAKf5msCv5J2IJ5V0,211
|
173
|
-
magic_pdf-0.9.
|
174
|
-
magic_pdf-0.9.
|
175
|
-
magic_pdf-0.9.
|
176
|
-
magic_pdf-0.9.
|
177
|
-
magic_pdf-0.9.
|
178
|
-
magic_pdf-0.9.
|
173
|
+
magic_pdf-0.9.2.dist-info/LICENSE.md,sha256=jVa0BUaKrRH4erV2P5AeJ24I2WRv9chIGxditreJ6e0,34524
|
174
|
+
magic_pdf-0.9.2.dist-info/METADATA,sha256=CxyxzxwoOTK3GfaQCGAR8lcjQR3fK4teYf0pXLVDiNQ,39654
|
175
|
+
magic_pdf-0.9.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
176
|
+
magic_pdf-0.9.2.dist-info/entry_points.txt,sha256=wXwYke3j8fqDQTocUspL-CqDUEv3Tfcwp09fM8dZAhA,98
|
177
|
+
magic_pdf-0.9.2.dist-info/top_level.txt,sha256=J9I0AzmHWGkp9c6DL8Oe4mEx3yYphLzkRn4H25Lg1rE,10
|
178
|
+
magic_pdf-0.9.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|