Commit Graph
810 Commits
Author SHA1 Message Date
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
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
myhloli 6a75d7dce5 perf(layout): optimize layout detection for PDF extraction
- Add initial setup for layout detection
- Implement conditional cropping for tall images
- Skip cropping for wide images to improve performance
- Reuse Image object across layout detection steps
2024-12-12 12:10:05 +08:00
xu rui 712d7d4a8d fix: classif pdf type 2024-12-11 19:50:35 +08:00
Xiaomeng Zhao bdacf29179 Merge pull request #1257 from icecraft/docs/refactor_en_docs
Docs/refactor en docs
2024-12-11 19:09:41 +08:00
myhloli 391a99860d Update version.py with new version 2024-12-11 10:56:15 +00:00
myhloli ef78819aa9 refactor(draw_bbox): remove redundant '_line_sort' suffix from output filename
- Updated the filename generation logic in the draw_bbox function
- Removed the unnecessary '_line_sort' suffix from the output PDF filename
2024-12-11 18:31:51 +08:00
myhloli 9efc35ecaa refactor(magic_pdf): remove unused import in pdf_parse_union_core_v2.py
- Remove unused import of ocr_model_init from magic_pdf.model.sub_modules.model_init
- Keep existing functionality and structure intact
2024-12-11 18:13:03 +08:00
myhloli f5d812b313 feat(layout): improve layout detection for DocLayout_YOLO model
- Implement image cropping and pasting technique to enhance layout detection
- Adjust detected polygons to original image coordinates
- Add comments for better code readability
2024-12-11 17:28:00 +08:00
xu rui 302a695078 feat: remove pipe_auto_mode 2024-12-11 17:00:17 +08:00
xu rui b04867f90a docs: check links in doc 2024-12-11 16:56:25 +08:00
xu rui cece8f5375 feat: support ms-office and images file in command line tools 2024-12-11 16:56:25 +08:00
xu rui 7dc3b0a9a2 docs: add quick_start example 2024-12-11 16:56:25 +08:00
xu rui 1d32722f5b fix: not create empty directory 2024-12-11 16:56:25 +08:00
xu rui f6af67eb11 feat: support convert ppt/pptx/doc/docx 2024-12-11 16:56:25 +08:00
xu rui f3ceebc41b fix: read_api list files 2024-12-11 16:56:25 +08:00
xu rui 6ca86beaa3 docs: rewrite install and usage docs 2024-12-11 16:56:25 +08:00
icecraft 4e7511fb86 fix: dup classify pdf type 2024-12-11 16:42:16 +08:00
myhloli 061c03a0db refactor(model): update import paths for PaddleOCR modules
- Change import paths from paddleocr.ppocr to ppocr for utility functions
- Update import paths for logging and utility modules in ppocr_273_mod.py- Modify import paths for tablemaster_paddle.py to use ppstructure instead of paddleocr.ppstructure
2024-12-11 01:49:24 +08:00
myhloli e1be7da644 refactor(magic_pdf): switch to pdfminer for invalid character detection
- Replace MuPDF with pdfminer for detecting invalid characters in PDFs
- Uncomment and update the detect_invalid_chars function to use pdfminer
- Update the check_invalid_chars function in pdf_meta_scan.py to use the new implementation
2024-12-11 01:41:35 +08:00
myhloli 01cd633ded refactor(tablemaster): update import paths for TableSystem and init_args
- Change import path for TableSystem from 'ppstructure.table.predict_table' to 'paddleocr.ppstructure.table.predict_table'
- Change import path for init_args from 'ppstructure.utility' to 'paddleocr.ppstructure.utility'
2024-12-11 01:26:18 +08:00
myhloli 56fad23d67 refactor(magic_pdf): update paddleocr module import paths
- Modify import paths for paddleocr utilities in ocr_utils.py and ppocr_273_mod.py
- Change from `ppocr.utils.utility` to `paddleocr.ppocr.utils.utility`
- Update related import statements in two files to reflect the new path
2024-12-11 01:24:02 +08:00
myhloli 52dfdd5354 refactor(magic_pdf): remove unnecessary comment
- Remove commented-out call to clean_memory() function
- This change simplifies the code by eliminating an unused code snippet
2024-12-10 20:05:22 +08:00
myhloli dd7f6781f6 fix(magic_pdf): disable PaddlePaddle signal handler
- Import paddle module and disable its signal handler to prevent interference with other components
- This change addresses potential conflicts between PaddlePaddle and other libraries or system signals
2024-12-10 18:11:59 +08:00
myhloli 2b6e94424c refactor: comment out clean_memory function call
- Remove the call to clean_memory() function from pdf_parse_union_core_v2.py
- This change may affect memory usage and needs to be tested to ensure proper functionality
2024-12-10 17:50:51 +08:00
myhloli a296ea41f9 refactor(magic_pdf): optimize environment setup and dependencies
- Add environment variables to disable albumentations and yolo updates
- Import torchtext and disable deprecation warnings
- Update unimernet to 0.2.2
- Specify ultralytics version as >=8.3.48
- Remove upper version limit for torch
2024-12-09 18:08:27 +08:00
icecraft 113448903a fix: unicode decode error 2024-12-09 13:58:27 +08:00
icecraft 57f9f9dcf9 fix: add parse_pdf_type and version 2024-12-09 11:20:21 +08:00
Xiaomeng Zhao 8f26686914 Merge pull request #1224 from icecraft/fix/new_api 2024-12-07 23:50:07 +08:00
sawmice 87af738ab1 fix: 1. ocr txt mode error 2. lose pdf_parse_type field 2024-12-07 18:03:39 +08:00
Xiaomeng Zhao f58a7a7d77 Merge pull request #1222 from myhloli/dev
fix(dict2md): add space for inline equations in CJK contexts
2024-12-07 17:54:34 +08:00
myhloli 74ee428bbb fix(dict2md): add space for inline equations in CJK contexts
- In Chinese, Japanese, and Korean (CJK) languages, no space is needed for line breaks within paragraphs.
- However, if an inline equation is at the end of a line, a space should be added to separate it from the following text.
- This change improves the formatting of documents containing both CJK text and inline equations.
2024-12-07 17:53:54 +08:00
Xiaomeng Zhao fa113b5750 Merge pull request #1178 from icecraft/refactor/add_user_api
Refactor/add user api
2024-12-06 20:55:33 +08:00
myhloli 012a46e07d refactor(magic-pdf): optimize model initialization and concurrency control
- Remove concurrency limit logic from app.py
- Update model initialization process in various modules
- Remove unused VRAM check for concurrency limit
- Refactor OCR model initialization in pdf_extract_kit.py
- Update txt_spans_extract_v2 function to use lang parameter instead of ocr_model
2024-12-06 20:35:43 +08:00
myhloli 47a83d28f5 refactor(ocr): replace AtomModelSingleton with ocr_model_init for OCR model instantiation
- Remove usage of AtomModelSingleton for OCR model creation
- Add ocr_model_init function to initialize OCR model
- Update OCR model initialization in pdf_extract_kit.py and pdf_parse_union_core_v2.py
- Modify txt_spans_extract_v2 function to accept ocr_model as a parameter
- Update parse_page_core function to use ocr_model instead of lang for OCR processing
2024-12-06 19:25:58 +08:00
myhloli f2a92d5782 refactor(model): implement thread-safe OCR model initialization
- Add threading support for OCR model initialization
- Modify AtomModelSingleton to handle thread-specific instances
- Update PDFExtractKit and PDFParseUnionCoreV2 to use new thread-safe OCR initialization
2024-12-06 18:40:26 +08:00
myhloli a1744b770f refactor(magic_pdf): remove unused threading lock and model initialization code
- Remove threading.Lock import and usage
- Delete unused model initialization comments and code- Simplify OCR model initialization in both pdf_extract_kit.py and pdf_parse_union_core_v2.py
2024-12-06 17:10:14 +08:00
myhloli 30220233ab refactor(magic_pdf): replace AtomModelSingleton with ocr_model_init for OCR model instantiation
- Remove usage of AtomModelSingleton for OCR model initialization- Use ocr_model_init function for creating OCR model instance
- Update import statement to include ocr_model_init- Comment out old OCR model initialization code
2024-12-06 16:11:46 +08:00
myhloli 488660dddd refactor(model): replace AtomModelSingleton with ocr_model_init for OCR model initialization
- Remove usage of AtomModelSingleton for OCR model initialization
- Add import of ocr_model_init from model_init module
- Update OCR model initialization process to use ocr_model_init function
- Remove lock for OCR processing as it's no longer needed
2024-12-06 15:43:41 +08:00
myhloli 6f636b6e7e refactor(model): replace ModelSingleton with direct model initialization and improve threading
- Remove usage of ModelSingleton class
- Initialize model directly using custom_model_init function
- Add self._lock attribute to PDFExtractKit class for thread safety- Replace local lock with self._lock for OCR processing
2024-12-06 15:17:59 +08:00
myhloli a9723c61fe fix(model): simplify model initialization logic 2024-12-06 15:08:00 +08:00
赵小蒙 878f3de004 refactor(magic_pdf): optimize model initialization and threading
- Remove unnecessary threading.Lock in AtomModelSingleton
- Add threading.Lock to CustomPEKModel for OCR processing
- Simplify model initialization logic in AtomModelSingleton
2024-12-06 10:28:25 +08:00
myhloli ce592f8bcf perf(model): optimize model initialization
- Add condition to return existing model if already initialized
- Improve efficiency by avoiding redundant model creation
2024-12-06 09:59:22 +08:00
myhloli 044780951a perf(model): add threading lock for OCR model initialization
- Introduce a lock to synchronize access to OCR model initialization- This change improves thread safety when multiple threads access the OCR model concurrently
- The lock ensures that the OCR model is initialized only once, even in multi-threaded scenarios
2024-12-05 11:09:39 +08:00
myhloli 104273cc79 fix(vram): improve VRAM checking logic
- Update VRAM checking logic in app.py and model_utils.py
- Add None and type checks for VRAM values
- Adjust concurrency limit calculation in app.py
- Modify clean_vram function to handle cases with no VRAM information
2024-12-03 14:22:35 +08:00
xu rui 11994506e0 feat: add zh_cn docs 2024-12-03 14:06:58 +08:00
xu rui f6bd47de6a docs: add dataset method description 2024-12-03 14:06:58 +08:00
xu rui d44e7a28f4 refactor: add docs 2024-12-03 14:06:58 +08:00
icecraft 4a82d6a07a feat: add function definitions 2024-12-03 14:06:58 +08:00
icecraft a3a720ea87 refactor: isolate inference and pipeline 2024-12-03 14:06:58 +08:00