Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Yuliang-Liu/MonkeyOCR
/ functions
Functions
485 in github.com/Yuliang-Liu/MonkeyOCR
⨍
Functions
485
◇
Types & classes
66
↳
Endpoints
7
Function
find_top_nearest_text_bbox
(pymu_blocks, obj_bbox)
magic_pdf/libs/boxbase.py:247
Function
float_equal
(a, b)
magic_pdf/libs/local_math.py:6
Function
float_gt
(a, b)
magic_pdf/libs/local_math.py:1
Method
forward
(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
Function
get_bbox_in_boundary
(bboxes: list, boundary: tuple)
magic_pdf/libs/boxbase.py:231
Method
get_compress_pdf_mid_data
Compress the pipeline result. Returns: str: compress the pipeline result and return
magic_pdf/operators/pipes_llm.py:173
Function
get_device
()
magic_pdf/libs/config_reader.py:79
Method
get_doc
Get the pymudoc page.
magic_pdf/data/dataset.py:21
Method
get_doc
Get the pymudoc object. Returns: fitz.Page: the pymudoc object
magic_pdf/data/dataset.py:525
Method
get_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
Method
get_image
Transform data to image.
magic_pdf/data/dataset.py:16
Method
get_imgs
(self, page_no: int)
magic_pdf/model/magic_model.py:498
Method
get_infer_res
Get the inference result. Returns: list: the inference result generated by model
magic_pdf/operators/models_llm.py:52
Function
get_local_layoutreader_model_dir
()
magic_pdf/libs/config_reader.py:67
Function
get_local_models_dir
()
magic_pdf/libs/config_reader.py:57
Method
get_ocr_text
(self, page_no: int)
magic_pdf/model/magic_model.py:530
Function
get_overlap_area
(bbox1, bbox2)
magic_pdf/libs/boxbase.py:390
Method
get_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
Method
get_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
Method
get_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
Method
get_page_info
Get the page info of the page. Returns: PageInfo: the page info of this page
magic_pdf/data/dataset.py:26
Method
get_queue_status
Get queue status (for monitoring)
magic_pdf/model/custom_model.py:826
Method
get_queue_status
Get queue status (for monitoring)
magic_pdf/model/custom_model.py:1188
Function
get_res_list_from_layout_res
(layout_res)
magic_pdf/model/sub_modules/model_utils.py:27
Function
get_s3_config_dict
(path: str)
magic_pdf/libs/config_reader.py:47
Function
get_svgs_per_page
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:256
Method
get_tables
( self, page_no: int )
magic_pdf/model/magic_model.py:501
Function
health_check
Health check endpoint
api/main.py:85
Method
infer_one
(img_path: str, q: str, req_id: str)
magic_pdf/model/async_vllm.py:54
Method
insert_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
Function
is_vbox_on_side
(bbox, width, height, side_threshold=0.2)
magic_pdf/libs/boxbase.py:240
Function
lifespan
Lifespan event handler
api/main.py:51
Function
load_file
(file, texts)
demo/demo_gradio.py:278
Function
load_images_from_pdf
(pdf_bytes: bytes, dpi=200, start_page_id=0, end_page_id=None)
magic_pdf/data/utils.py:35
Function
load_images_sync
()
api/main.py:348
Function
main
(json_file)
magic_pdf/filter/pdf_classify_by_type.py:316
Function
ocr_mk_mm_markdown_with_para_and_pagination
(pdf_info_dict: list, img_buket_path)
magic_pdf/dict2md/ocr_mkcontent.py:26
Function
parse_and_update_view
Parse PDF and update view
demo/demo_gradio.py:315
Function
parse_document
Parse complete document (PDF or image)
api/main.py:105
Function
parse_document_split
Parse complete document and split result by pages (PDF or image)
api/main.py:110
Method
pipe_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
Method
pipe_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
Method
proc
(*args, **kwargs)
magic_pdf/operators/models_llm.py:95
Function
process_page_sync
()
api/main.py:262
Function
process_single_sync
()
api/main.py:289
Method
read
Read the file. Args: path (str): file path to read Returns: bytes: the content of the file
magic_pdf/data/io/base.py:6
Method
read
Read the file. Args: path (str): file path to read Returns: bytes: the content of the file
magic_pdf/data/io/http.py:11
Method
read
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
Method
read_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
Method
read_at
Not Implemented.
magic_pdf/data/io/http.py:22
Method
read_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
Function
read_file_sync
()
api/main.py:156
Function
read_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
Function
read_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
Function
read_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
Function
read_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
Function
read_result_sync
()
api/main.py:597
Method
remove_duplicate_spans
(spans)
magic_pdf/model/magic_model.py:545
Function
remove_overlap_between_bbox_for_block
(all_bboxes)
magic_pdf/pre_proc/remove_bbox_overlap.py:91
Function
remove_overlap_between_bbox_for_span
(spans)
magic_pdf/pre_proc/remove_bbox_overlap.py:79
Function
replace_html_latex_table
(match)
demo/demo_gradio.py:182
Function
replace_image_with_base64
(match)
demo/demo_gradio.py:194
Function
root
Redirect root path to docs
api/main.py:80
Method
run_async_in_thread
()
magic_pdf/model/custom_model.py:749
Method
run_async_in_thread
()
magic_pdf/model/custom_model.py:1111
Method
run_in_thread
()
magic_pdf/model/async_vllm.py:119
Function
run_inference_sync
()
api/main.py:175
Method
safe_encode
(data: str, method: str)
magic_pdf/data/data_reader_writer/base.py:52
Function
sanitize_filename
(filename, replacement="_")
magic_pdf/libs/safe_filename.py:4
Method
sanitize_html
(output)
magic_pdf/model/batch_analyze_llm.py:176
Method
sanitize_md
(output)
magic_pdf/model/batch_analyze_llm.py:172
Method
sanitize_mf
(output:str)
magic_pdf/model/batch_analyze_llm.py:174
Function
save_results_sync
()
api/main.py:392
Method
single_inference
(self, image: Union[str, Image.Image], question: str)
magic_pdf/model/custom_model.py:442
Method
single_inference
Synchronous single inference (wraps async method)
magic_pdf/model/custom_model.py:741
Method
single_inference
Synchronous single inference (wraps async method)
magic_pdf/model/custom_model.py:1103
Method
supported_methods
The methods that this dataset support. Returns: list[SupportedPdfParseMethod]: The supported methods, Valid methods are: OCR, TXT
magic_pdf/data/dataset.py:73
Method
supported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:161
Method
supported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:245
Method
supported_methods
The method supported by this dataset. Returns: list[SupportedPdfParseMethod]: the supported methods
magic_pdf/data/dataset.py:400
Function
switch_language
(lang)
demo/demo_gradio.py:383
Function
vis_polygons_with_index
(image, points)
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:220
Method
write
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
Method
write
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
Method
write
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
← previous
401–485 of 485, ranked by callers