Commit Graph
2082 Commits
Author SHA1 Message Date
myhloli 04febf52d0 refactor(ocr): comment out unnecessary log statement
- Remove logger.info() call for additional_ocr_params to reduce log verbosity
2025-01-03 17:31:57 +08:00
myhloli 512adb6701 feat(model): add onnxruntime support for paddleocr on cpu
- Implement ONNXModelSingleton to manage ONNX models
- Modify ModifiedPaddleOCR to use ONNX models on ARM CPUs without CUDA
- Update RapidTableModel to use RapidOCR with ONNXRuntime on CPU
- Add rapidocr_onnxruntime dependency in setup.py
2025-01-03 16:27:52 +08:00
myhloli 7c5cdcd4d7 refactor(pdf_parse): improve character spacing handling in PDF text extraction
- Update the logic for inserting spaces between characters- Consider the next character's position instead of the previous one
- Adjust the spacing threshold to 25% of the average character width
- Ignore spaces at the end of lines to prevent double spaces
2025-01-02 14:24:37 +08:00
myhloli 88b909e20e refactor(magic_pdf): comment out npu-related code
- Remove use_npu variable initialization
- Comment out device assignment and npu check
- Comment out use_npu parameter in ModifiedPaddleOCR constructor
2024-12-30 14:18:02 +08:00
myhloli 2684e7753b fix(npu): correct module name for NPU operations
- Update `clean_memory.py` to use `torch_npu.npu` instead of `torch.npu`
- Update `model_utils.py` to use `torch_npu.npu` instead of `torch.npu`
- Simplify NPU availability check and bfloat16 support in `pdf_parse_union_core_v2.py`
2024-12-30 10:10:44 +08:00
myhloli 2e87e649ed build(deps): update pydantic to latest version
- Remove upper version limit for pydantic dependency
- This change allows for the use of the latest pydantic version
2024-12-30 10:04:14 +08:00
myhloli dc0d30f5c8 build: add openai to requirements-docker.txt
- Add openai package to requirements-docker.txt
2024-12-27 15:00:06 +08:00
myhloli 50f4841716 refactor(device): optimize memory cleaning and device selection
- Update clean_memory function to support both CUDA and NPU devices
- Implement get_device function to centralize device selection logic
- Modify model initialization and memory cleaning to use the selected device
- Update RapidTableModel to support both RapidOCR and PaddleOCR engines
2024-12-26 18:13:51 +08:00
myhloli 7990e7dfbb feat(model): add npu support and optimize table model
- Add NPU support for memory cleaning and model initialization
- Optimize table model initialization and prediction process
- Update memory utils to support NPU
- Add language parameter for table model
2024-12-26 17:30:00 +08:00
myhloli 96f8da2aff build(deps): upgrade unimernet to 0.2.3
- Update unimernet from 0.2.2 to 0.2.3 in requirements-docker.txt and setup.py
- Remove torchtext/eva-decord dependency
2024-12-26 15:39:14 +08:00
myhloli 192047a1e8 refactor(magic_pdf): remove unnecessary logging statements
- Comment out logging statements for title list, title completion, and length comparison
- Improve code readability and reduce clutter by removing unused debug information
2024-12-25 18:06:09 +08:00
myhloli 0a468eca6e feat(llm_aided): add title optimization feature
- Implement llm_aided_title function to optimize document titles using LLM
- Update pdf_parse_union_core_v2.py to include title optimization
- Modify ocr_mkcontent.py to use optimized title levels- Add openai SDK dependency in setup.py
2024-12-25 18:03:38 +08:00
Xiaomeng Zhao da3257a631 Merge pull request #1352 from myhloli/add-llm-aided
feat(llm): add LLM-aided formula and text correction
2024-12-24 14:35:16 +08:00
myhloli c660fdc8f0 feat(llm): add LLM-aided formula and text correction
- Add LLM-aided formula and text correction functionality
- Update config reader to include LLM-aided settings
- Create new LLM-aided processing module
- Update main processing script to incorporate LLM-aided corrections
- Modify download scripts to check for new config version
2024-12-24 14:33:35 +08:00
Xiaomeng Zhao 0281048d83 Merge pull request #1338 from myhloli/dev
refactor(pre_proc): improve character overlap handling in spans
2024-12-20 17:36:10 +08:00
myhloli 24dfd1a0cf Merge remote-tracking branch 'origin/dev' into dev 2024-12-20 17:34:29 +08:00
myhloli 15e876677d refactor(pre_proc): improve character overlap handling in spans
- Remove remove_overlaps_chars function
- Add check_chars_is_overlap_in_span function
- Update span processing logic to handle character overlaps- Improve efficiency and readability of overlap detection
2024-12-20 17:33:50 +08:00
Xiaomeng Zhao 58b2e78dd3 Merge pull request #1336 from icecraft/docs/add_more_method_usage
docs: add more method description
2024-12-20 17:10:35 +08:00
xu rui 24ee9c41e2 docs: add more method description 2024-12-20 15:41:00 +08:00
Xiaomeng Zhao a9dea5f0f8 Merge pull request #1330 from myhloli/dev
feat(demo): add demo script for PDF processing
2024-12-19 18:24:37 +08:00
myhloli d6a291623b feat(demo): add demo script for PDF processing
- Create demo.py script for PDF file processing
- Implement PDF reading, classification, and inference usingOpendatalab's magic_pdf library- Add pipelines for OCR and text modes
- Include result visualization and markdown export
2024-12-19 18:23:52 +08:00
Xiaomeng Zhao 5eb9feee11 Merge pull request #1329 from myhloli/dev
feat(pre_proc): add function to remove overlapping characters in spans
2024-12-19 15:22:51 +08:00
myhloli 2f4d4b0c80 feat(pre_proc): add function to remove overlapping characters in spans
- Implement remove_overlaps_chars function to detect and remove overlapping characters within spans
- Integrate remove_overlaps_chars function into the PDF parsing process
- Improve character-level processing and reduce redundancy in OCR results
2024-12-19 15:20:51 +08:00
Xiaomeng Zhao 7248676d8f Merge pull request #1325 from pangguosheng1106/dev
fix: skip the char corresponding to invalid bounding boxes
2024-12-19 14:46:51 +08:00
pangguosheng 1e6de549a8 fix: drop reason append error 2024-12-19 01:10:59 +08:00
pangguosheng 51b8c57df2 fix: skip the char corresponding to invalid bounding boxes 2024-12-19 00:35:44 +08:00
Xiaomeng Zhao b71993a97f Merge pull request #1323 from myhloli/dev
feat(gradio-app): improve PDF conversion and UI functionalities
2024-12-18 19:08:18 +08:00
myhloli bf2ff5a241 feat(gradio-app): improve PDF conversion and UI functionalities
- Add automatic conversion of uploaded files to PDF
- Update max page slider range and default value- Prevent interaction with PDF preview to avoid errors
- Increase Markdown rendering height for better visibility
- Update file change event handling for PDF conversion
- Modify supported image suffixes for file upload
2024-12-18 19:07:15 +08:00
Xiaomeng Zhao e1d69928ba Merge pull request #1322 from myhloli/dev
refactor(magic_pdf): move model config variables
2024-12-18 17:26:45 +08:00
myhloli 489f70e91d refactor(magic_pdf): move model config variables
- Move __use_inside_model__ and __model_mode__ from operators/__init__.py to model/__init__.py
- These variables are more appropriately located in the model module since they relate to model configuration
2024-12-18 17:26:06 +08:00
Xiaomeng Zhao 34cd1350a9 Merge pull request #1321 from icecraft/docs/fix_docs
Docs/fix docs
2024-12-18 15:36:17 +08:00
icecraft c968ce860d fix: remove pipe_auto_method 2024-12-18 15:33:41 +08:00
xu rui cd11ddcd6b docs: make sure the generate process of docs work properly 2024-12-18 15:22:56 +08:00
Xiaomeng Zhao d94ddcf81c Merge pull request #1318 from icecraft/refactor/code_struture
refactor: refactor code
2024-12-18 14:30:22 +08:00
icecraft b2887ca0aa refactor: refactor code 2024-12-18 14:19:41 +08:00
Xiaomeng Zhao 303a4b01ec Merge pull request #1313 from icecraft/fix/abs_pipe_dev 2024-12-17 19:25:13 +08:00
icecraft 78f56a1ed0 fix: AbsPipe initial method 2024-12-17 19:22:54 +08:00
Xiaomeng Zhao 3f64c16ba9 Merge pull request #1311 from myhloli/add-auto-lang
feat(language-detection): add YOLOv11 language detection model
2024-12-17 19:11:21 +08:00
myhloli 20438bd2b7 feat(language-detection): add YOLOv11 language detection model
- Add YOLOv11 language detection model for PDF documents
- Implement language detection in PymuDocDataset
- Update app.py to include 'auto' language option
- Create language detection utilities and constants
2024-12-17 19:06:50 +08:00
Xiaomeng Zhao fb6db2d9cf Merge pull request #1304 from icecraft/feat/add_get_middle_json
feat: add get_middle_json method
2024-12-17 14:13:13 +08:00
icecraft e9d36221dd feat: add get_middle_json method 2024-12-17 10:46:17 +08:00
Xiaomeng Zhao 51fd53d9af Merge pull request #1301 from myhloli/add-auto-lang
refactor(magic_pdf): remove YOLO_VERBOSE setting and update YOLOv8 prediction verbosity
2024-12-16 17:28:37 +08:00
myhloli 9e4ebea939 refactor(magic_pdf): remove YOLO_VERBOSE setting and update YOLOv8 prediction verbosity
- Remove YOLO_VERBOSE environment variable from multiple files
- Set verbose=False in YOLOv8 prediction method to suppress logger output
2024-12-16 17:27:19 +08:00
Xiaomeng Zhao 0d5a1c74ad Merge pull request #1292 from dt-yy/dev 2024-12-14 01:11:17 +08:00
dt-yy 905c4ae5aa update case 2024-12-13 19:05:37 +08:00
dt-yy 97e11346e5 update test case 2024-12-13 18:59:21 +08:00
dt-yy 54c23a5351 update test case 2024-12-13 18:58:10 +08:00
Xiaomeng Zhao 379cf15013 Merge pull request #1291 from myhloli/add-llm-aided
fix(pdf): improve ligature handling and text extraction
2024-12-13 15:44:19 +08:00
myhloli c638fc5d1f fix(pdf): improve ligature handling and text extraction
- Move ligature replacement function to pdf_parse_union_core_v2.py
- Optimize ligature replacement using a more efficient approach
- Modify text extraction flags to preserve ligatures in PDF content
- Remove unnecessary function from ocr_mkcontent.py
2024-12-13 15:43:05 +08:00
Xiaomeng Zhao 5e3890f560 Merge pull request #1289 from icecraft/docs/fix_image_path
docs: fix image path
2024-12-13 11:31:47 +08:00