MCPcopy Create free account

hub / github.com/Yuliang-Liu/MonkeyOCR / functions

Functions485 in github.com/Yuliang-Liu/MonkeyOCR

Functionfind_top_nearest_text_bbox
(pymu_blocks, obj_bbox)
magic_pdf/libs/boxbase.py:247
Functionfloat_equal
(a, b)
magic_pdf/libs/local_math.py:6
Functionfloat_gt
(a, b)
magic_pdf/libs/local_math.py:1
Methodforward
(self, input_ids=None, bbox=None, attention_mask=None, labels=None, category_ids=None, **kwargs)
magic_pdf/model/sub_modules/reading_oreder/layoutreader/helpers.py:20
Functionget_bbox_in_boundary
(bboxes: list, boundary: tuple)
magic_pdf/libs/boxbase.py:231
Methodget_compress_pdf_mid_data
Compress the pipeline result. Returns: str: compress the pipeline result and return
magic_pdf/operators/pipes_llm.py:173
Functionget_device
()
magic_pdf/libs/config_reader.py:79
Methodget_doc
Get the pymudoc page.
magic_pdf/data/dataset.py:21
Methodget_doc
Get the pymudoc object. Returns: fitz.Page: the pymudoc object
magic_pdf/data/dataset.py:525
Methodget_file_page_count
Get the page count for a specific file. Args: file_index (int): Index of the file Returns:
magic_pdf/data/dataset.py:473
Methodget_image
Transform data to image.
magic_pdf/data/dataset.py:16
Methodget_imgs
(self, page_no: int)
magic_pdf/model/magic_model.py:498
Methodget_infer_res
Get the inference result. Returns: list: the inference result generated by model
magic_pdf/operators/models_llm.py:52
Functionget_local_layoutreader_model_dir
()
magic_pdf/libs/config_reader.py:67
Functionget_local_models_dir
()
magic_pdf/libs/config_reader.py:57
Methodget_ocr_text
(self, page_no: int)
magic_pdf/model/magic_model.py:530
Functionget_overlap_area
(bbox1, bbox2)
magic_pdf/libs/boxbase.py:390
Methodget_page
The page doc object. Args: page_id (int): the page doc index Returns: PageableData: the page doc object
magic_pdf/data/dataset.py:173
Methodget_page
The page doc object. Args: page_id (int): the page doc index Returns: PageableData: the page doc object
magic_pdf/data/dataset.py:257
Methodget_page
The page doc object. Args: page_id (int): the page doc index Returns: PageableData: the page doc object
magic_pdf/data/dataset.py:412
Methodget_page_info
Get the page info of the page. Returns: PageInfo: the page info of this page
magic_pdf/data/dataset.py:26
Methodget_queue_status
Get queue status (for monitoring)
magic_pdf/model/custom_model.py:826
Methodget_queue_status
Get queue status (for monitoring)
magic_pdf/model/custom_model.py:1188
Functionget_res_list_from_layout_res
(layout_res)
magic_pdf/model/sub_modules/model_utils.py:27
Functionget_s3_config_dict
(path: str)
magic_pdf/libs/config_reader.py:47
Functionget_svgs_per_page
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:256
Methodget_tables
( self, page_no: int )
magic_pdf/model/magic_model.py:501
Functionhealth_check
Health check endpoint
api/main.py:85
Methodinfer_one
(img_path: str, q: str, req_id: str)
magic_pdf/model/async_vllm.py:54
Methodinsert_text
insert text. Args: coord (list[float]): four elements array contain the top-left and bottom-right coordinates, [x0, y0, x1, y1]
magic_pdf/data/dataset.py:49
Functionis_vbox_on_side
(bbox, width, height, side_threshold=0.2)
magic_pdf/libs/boxbase.py:240
Functionlifespan
Lifespan event handler
api/main.py:51
Functionload_file
(file, texts)
demo/demo_gradio.py:278
Functionload_images_from_pdf
(pdf_bytes: bytes, dpi=200, start_page_id=0, end_page_id=None)
magic_pdf/data/utils.py:35
Functionload_images_sync
()
api/main.py:348
Functionmain
(json_file)
magic_pdf/filter/pdf_classify_by_type.py:316
Functionocr_mk_mm_markdown_with_para_and_pagination
(pdf_info_dict: list, img_buket_path)
magic_pdf/dict2md/ocr_mkcontent.py:26
Functionparse_and_update_view
Parse PDF and update view
demo/demo_gradio.py:315
Functionparse_document
Parse complete document (PDF or image)
api/main.py:105
Functionparse_document_split
Parse complete document and split result by pages (PDF or image)
api/main.py:110
Methodpipe_ocr_mode
Post-proc the model inference result, Extract the text using `OCR` technical. Args: imageWriter (DataWriter): the image w
magic_pdf/operators/models_llm.py:72
Methodpipe_txt_mode
Post-proc the model inference result, Extract the text using the third library, such as `pymupdf` Args: imageWriter (Data
magic_pdf/operators/__init__.py:62
Methodproc
(*args, **kwargs)
magic_pdf/operators/models_llm.py:95
Functionprocess_page_sync
()
api/main.py:262
Functionprocess_single_sync
()
api/main.py:289
Methodread
Read the file. Args: path (str): file path to read Returns: bytes: the content of the file
magic_pdf/data/io/base.py:6
Methodread
Read the file. Args: path (str): file path to read Returns: bytes: the content of the file
magic_pdf/data/io/http.py:11
Methodread
Read the path from s3, select diffect bucket client for each request based on the bucket, also support range read. Args:
magic_pdf/data/data_reader_writer/multi_bucket_s3.py:52
Methodread_at
Read at offset and limit. Args: path (str): the path of file, if the path is relative path, it will be joined with parent_dir.
magic_pdf/data/io/base.py:18
Methodread_at
Not Implemented.
magic_pdf/data/io/http.py:22
Methodread_at
Read at offset and limit. Args: path (str): the path of file, if the path is relative path, it will be joined with parent_dir.
magic_pdf/data/data_reader_writer/filebase.py:15
Functionread_file_sync
()
api/main.py:156
Functionread_jsonl
Read the jsonl file and return the list of PymuDocDataset. Args: s3_path_or_local (str): local file or s3 path s3_client (MultiBu
magic_pdf/data/read_api.py:13
Functionread_local_images
Read images from path or directory. Args: path (str): image file path or directory that contains image files suffixes (list[str])
magic_pdf/data/read_api.py:119
Functionread_local_office
Read ms-office file (ppt, pptx, doc, docx) from path or directory. Args: path (str): ms-office file or directory that contains ms-office
magic_pdf/data/read_api.py:76
Functionread_local_pdfs
Read pdf from path or directory. Args: path (str): pdf file path or directory that contains pdf files Returns: list[PymuDocD
magic_pdf/data/read_api.py:53
Functionread_result_sync
()
api/main.py:597
Methodremove_duplicate_spans
(spans)
magic_pdf/model/magic_model.py:545
Functionremove_overlap_between_bbox_for_block
(all_bboxes)
magic_pdf/pre_proc/remove_bbox_overlap.py:91
Functionremove_overlap_between_bbox_for_span
(spans)
magic_pdf/pre_proc/remove_bbox_overlap.py:79
Functionreplace_html_latex_table
(match)
demo/demo_gradio.py:182
Functionreplace_image_with_base64
(match)
demo/demo_gradio.py:194
Functionroot
Redirect root path to docs
api/main.py:80
Methodrun_async_in_thread
()
magic_pdf/model/custom_model.py:749
Methodrun_async_in_thread
()
magic_pdf/model/custom_model.py:1111
Methodrun_in_thread
()
magic_pdf/model/async_vllm.py:119
Functionrun_inference_sync
()
api/main.py:175
Methodsafe_encode
(data: str, method: str)
magic_pdf/data/data_reader_writer/base.py:52
Functionsanitize_filename
(filename, replacement="_")
magic_pdf/libs/safe_filename.py:4
Methodsanitize_html
(output)
magic_pdf/model/batch_analyze_llm.py:176
Methodsanitize_md
(output)
magic_pdf/model/batch_analyze_llm.py:172
Methodsanitize_mf
(output:str)
magic_pdf/model/batch_analyze_llm.py:174
Functionsave_results_sync
()
api/main.py:392
Methodsingle_inference
(self, image: Union[str, Image.Image], question: str)
magic_pdf/model/custom_model.py:442
Methodsingle_inference
Synchronous single inference (wraps async method)
magic_pdf/model/custom_model.py:741
Methodsingle_inference
Synchronous single inference (wraps async method)
magic_pdf/model/custom_model.py:1103
Methodsupported_methods
The methods that this dataset support. Returns: list[SupportedPdfParseMethod]: The supported methods, Valid methods are: OCR, TXT
magic_pdf/data/dataset.py:73
Methodsupported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:161
Methodsupported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:245
Methodsupported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:400
Functionswitch_language
(lang)
demo/demo_gradio.py:383
Functionvis_polygons_with_index
(image, points)
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:220
Methodwrite
Write file with data. Args: path (str): the path of file, if the path is relative path, it will be joined with parent_dir.
magic_pdf/data/io/base.py:35
Methodwrite
Write file with data. Args: path (str): the path of file, if the path is relative path, it will be joined with parent_dir.
magic_pdf/data/io/http.py:28
Methodwrite
Write file with data, also select diffect bucket client for each request based on the bucket. Args: path (str): the path
magic_pdf/data/data_reader_writer/multi_bucket_s3.py:130
← previous401–485 of 485, ranked by callers