MCPcopy Create free account

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

Functions485 in github.com/Yuliang-Liu/MonkeyOCR

↓ 1 callersFunctionget_current_file_parent_parent_dir
()
magic_pdf/libs/config_reader.py:14
↓ 1 callersMethodget_discarded
(self, page_no: int)
magic_pdf/model/magic_model.py:518
↓ 1 callersMethodget_equations
(self, page_no: int)
magic_pdf/model/magic_model.py:506
↓ 1 callersMethodget_image
Return the image info. Returns: dict: { img: np.ndarray, width: int, height: int
magic_pdf/data/dataset.py:513
↓ 1 callersFunctionget_image_info
(doc: fitz.Document, page_width_pts, page_height_pts)
magic_pdf/filter/pdf_meta_scan.py:60
↓ 1 callersFunctionget_imgs_per_page
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:270
↓ 1 callersMethodget_infer_res
Get the inference result. Returns: list: the inference result generated by model
magic_pdf/operators/__init__.py:41
↓ 1 callersFunctionget_language
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:280
↓ 1 callersFunctionget_line_height
(blocks)
magic_pdf/pdf_parse_union_core_v2_llm.py:491
↓ 1 callersMethodget_page_size
(self, page_no: int)
magic_pdf/model/magic_model.py:588
↓ 1 callersFunctionget_pdf_page_size_pts
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:140
↓ 1 callersFunctionget_pdf_text_layout_per_page
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:178
↓ 1 callersFunctionget_pdf_textlen_per_page
(doc: fitz.Document)
magic_pdf/filter/pdf_meta_scan.py:161
↓ 1 callersFunctionget_qa_need_list_v2
(blocks)
magic_pdf/pre_proc/ocr_span_list_modify.py:67
↓ 1 callersFunctionget_scale_ratio
(model_page_info, page)
magic_pdf/libs/coordinate_transform.py:1
↓ 1 callersMethodget_text_blocks
(self, page_no: int)
magic_pdf/model/magic_model.py:522
↓ 1 callersMethodget_title_blocks
(self, page_no: int)
magic_pdf/model/magic_model.py:526
↓ 1 callersFunctionget_vram
(device)
magic_pdf/model/sub_modules/model_utils.py:53
↓ 1 callersMethodimg2base64
(self, image: Union[str, Image.Image])
magic_pdf/model/custom_model.py:468
↓ 1 callersFunctioninitialize_model
Initialize MonkeyOCR model
api/main.py:45
↓ 1 callersFunctioninsert_lines_into_block
(block_bbox, line_height, page_w, page_h)
magic_pdf/pdf_parse_union_core_v2_llm.py:351
↓ 1 callersMethodinsert_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:567
↓ 1 callersFunctioniou
(box1, box2)
magic_pdf/pdf_parse_union_core_v2_llm.py:393
↓ 1 callersMethodis_model_loaded
(self)
magic_pdf/model/model_manager.py:53
↓ 1 callersFunctionis_narrow_strip
(img)
magic_pdf/filter/pdf_classify_by_type.py:244
↓ 1 callersFunctionload_image_from_base64
load image from base64 format.
magic_pdf/utils/load_image.py:47
↓ 1 callersFunctionmain
()
parse.py:639
↓ 1 callersFunctionmain
Main function providing command line interface
tools/lmdeploy_patcher.py:201
↓ 1 callersFunctionmain
()
tools/fix_qwen2_5_vl_awq.py:123
↓ 1 callersFunctionmerge_images
(image_list, page_width, page_height, max_offset=5, max_gap=2)
magic_pdf/filter/pdf_classify_by_type.py:27
↓ 1 callersFunctionmerge_title_blocks
(blocks, x_distance_threshold=0.1*page_w)
magic_pdf/pdf_parse_union_core_v2_llm.py:630
↓ 1 callersFunctionmerge_two_blocks
(b1, b2)
magic_pdf/pdf_parse_union_core_v2_llm.py:638
↓ 1 callersFunctionmfd_model_init
(weight, device='cpu')
magic_pdf/model/sub_modules/model_init.py:46
↓ 1 callersFunctionocr_cut_image_and_table
(spans, page, page_id, pdf_bytes_md5, imageWriter)
magic_pdf/pre_proc/cut_image.py:8
↓ 1 callersFunctionocr_escape_special_markdown_char
(content)
magic_pdf/libs/markdown_utils.py:2
↓ 1 callersFunctionocr_model_init
(det_db_box_thresh=0.3, lang=None, use_dilation=True,
magic_pdf/model/sub_modules/model_init.py:24
↓ 1 callersFunctionpaddex_layout_model_init
(device: str, model_dir: str = None, model_name: str = MODEL_NAME.PaddleXLayoutModel)
magic_pdf/model/sub_modules/model_init.py:17
↓ 1 callersFunctionpara_split
(pdf_info_dict)
magic_pdf/post_proc/para_split_v3.py:361
↓ 1 callersFunctionparse_bucket_key
(s3_full_path: str)
magic_pdf/libs/commons.py:26
↓ 1 callersFunctionparse_folder
Parse all PDF and image files in a folder Args: folder_path: Input folder path output_dir: Output directory conf
parse.py:20
↓ 1 callersFunctionparse_logits
parse logits to orders :param logits: logits from model :param length: input length :return: orders
magic_pdf/model/sub_modules/reading_oreder/layoutreader/helpers.py:137
↓ 1 callersFunctionparse_multi_file_group
Parse a group of mixed PDF and image files using MultiFileDataset Args: file_paths: List of file paths (PDF and images)
parse.py:222
↓ 1 callersFunctionparse_page_core
( page_doc: PageableData, magic_model, page_id, pdf_bytes_md5, imageWriter, parse_mode, lang, MonkeyOCR_mo
magic_pdf/pdf_parse_union_core_v2_llm.py:607
↓ 1 callersFunctionparse_pdf_and_return_results
(pdf_file)
demo/demo_gradio.py:142
↓ 1 callersFunctionparse_requirements
(filename)
setup.py:6
↓ 1 callersFunctionparse_s3_range_params
example: s3://abc/xxxx.json?bytes=0,81350 ==> [0, 81350]
magic_pdf/libs/path_utils.py:25
↓ 1 callersMethodpatch
Apply patch
tools/lmdeploy_patcher.py:106
↓ 1 callersFunctionpatch_calibrate_file
Patch the calibrate.py file by commenting out problematic code
tools/fix_qwen2_5_vl_awq.py:22
↓ 1 callersFunctionpdf_meta_scan
(pdf_bytes: bytes)
magic_pdf/filter/pdf_meta_scan.py:304
↓ 1 callersFunctionpdf_parse_union
( model_list, dataset: Dataset, imageWriter, parse_mode, MonkeyOCR_model, start_page_i
magic_pdf/pdf_parse_union_core_v2_llm.py:807
↓ 1 callersFunctionpoints_to_bbox
(points)
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:109
↓ 1 callersMethodpredict
(self, image: Union[np.ndarray, Image.Image])
magic_pdf/model/sub_modules/layout/paddlex_layout/PaddleXLayoutModel.py:88
↓ 1 callersMethodpredict
(self, image)
magic_pdf/model/sub_modules/layout/doclayout_yolo/DocLayoutYOLO.py:9
↓ 1 callersFunctionprepare_inputs
( inputs: Dict[str, torch.Tensor], model: LayoutLMv3ForTokenClassification )
magic_pdf/model/sub_modules/reading_oreder/layoutreader/helpers.py:125
↓ 1 callersMethodprepare_messages
(self, images: List[Union[str, Image.Image]], questions: List[str])
magic_pdf/model/custom_model.py:298
↓ 1 callersFunctionprocess_inference_results_async
Process inference results asynchronously
api/main.py:202
↓ 1 callersFunctionprocess_single_page_async
Process a single page result asynchronously
api/main.py:237
↓ 1 callersFunctionprocess_single_result_async
Process single result asynchronously
api/main.py:285
↓ 1 callersMethodread_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/s3.py:51
↓ 1 callersMethodread_at
Read the file at offset and limit. Args: path (str): the file path offset (int, optional): the number of bytes skippe
magic_pdf/data/data_reader_writer/base.py:19
↓ 1 callersMethodread_at
Read the file with offset and limit, select diffect bucket client for each request based on the bucket. Args: path (str):
magic_pdf/data/data_reader_writer/multi_bucket_s3.py:89
↓ 1 callersFunctionrecursive_xy_cut
(boxes: np.ndarray, indices: List[int], res: List[int])
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:60
↓ 1 callersFunctionremove_invalid_surrogates
(text)
magic_pdf/libs/language.py:15
↓ 1 callersFunctionremove_need_drop_blocks
(all_bboxes, discarded_blocks)
magic_pdf/pre_proc/ocr_detect_all_bboxes.py:191
↓ 1 callersFunctionremove_outside_spans
(spans, all_bboxes, all_discarded_blocks)
magic_pdf/pdf_parse_union_core_v2_llm.py:565
↓ 1 callersFunctionremove_overlaps_low_confidence_spans
(spans)
magic_pdf/pre_proc/ocr_span_list_modify.py:7
↓ 1 callersFunctionremove_overlaps_min_spans
(spans)
magic_pdf/pre_proc/ocr_span_list_modify.py:44
↓ 1 callersFunctionremove_tilted_line
(text_blocks)
magic_pdf/pdf_parse_union_core_v2_llm.py:165
↓ 1 callersFunctionrender_latex_table_to_image
Render LaTeX table to image and return base64 encoding
demo/demo_gradio.py:39
↓ 1 callersFunctionrestore_calibrate_file
Restore the calibrate.py file by removing comment symbols
tools/fix_qwen2_5_vl_awq.py:65
↓ 1 callersFunctionrevert_group_blocks
(blocks)
magic_pdf/pdf_parse_union_core_v2_llm.py:538
↓ 1 callersFunctionshow_usage
Show usage information
tools/fix_qwen2_5_vl_awq.py:117
↓ 1 callersMethodshutdown
Shutdown service
magic_pdf/model/custom_model.py:838
↓ 1 callersFunctionsingle_task_recognition_multi_file_group
Single task recognition for a group of mixed PDF and image files Args: file_paths: List of file paths (PDF and images) o
parse.py:339
↓ 1 callersFunctionsort_lines_by_model
(fix_blocks, page_w, page_h, line_height, MonkeyOCR_model)
magic_pdf/pdf_parse_union_core_v2_llm.py:430
↓ 1 callersFunctionsort_lines_by_ppv2
(fix_blocks, layout_bboxes)
magic_pdf/pdf_parse_union_core_v2_llm.py:392
↓ 1 callersFunctiontxt_spans_extract_v2
(pdf_page, spans, all_bboxes, all_discarded_blocks, lang)
magic_pdf/pdf_parse_union_core_v2_llm.py:180
↓ 1 callersMethodvalidate_connection
Validate the effectiveness of API URL and key
magic_pdf/model/custom_model.py:455
↓ 1 callersFunctionvis_points
Args: img: points: [N, 8] 8: x1,y1,x2,y2,x3,y3,x3,y4 texts: color: Returns:
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:169
↓ 1 callersFunctionvis_polygon
(img, points, thickness=2, color=None)
magic_pdf/model/sub_modules/reading_oreder/layoutreader/xycut.py:130
↓ 1 callersMethodwrite
Write the data to the file. Args: path (str): the target file where to write data (bytes): the data want to write
magic_pdf/data/data_reader_writer/base.py:35
FunctionImportPIL
(f)
magic_pdf/utils/annotations.py:5
Method__call__
(self, images: list, split_pages: bool = False, pred_abandon: bool = False)
magic_pdf/model/batch_analyze_llm.py:17
Method__call__
(self, features: List[dict])
magic_pdf/model/sub_modules/reading_oreder/layoutreader/helpers.py:32
Method__del__
Destructor
magic_pdf/model/custom_model.py:866
Method__del__
Destructor
magic_pdf/model/custom_model.py:1228
Method__getattr__
(self, name)
magic_pdf/data/dataset.py:543
Method__init__
(self)
tools/lmdeploy_patcher.py:6
Method__init__
(self, msg)
magic_pdf/utils/office_to_pdf.py:6
Method__init__
Initialized. Args: pipe_res (list[dict]): the pipeline processed result of model inference result dataset (Dataset):
magic_pdf/operators/pipes_llm.py:16
Method__init__
Initialized method. Args: inference_results (list): the inference result generated by model dataset (Dataset): the da
magic_pdf/operators/__init__.py:12
Method__init__
Initialized method. Args: inference_results (list): the inference result generated by model dataset (Dataset): the da
magic_pdf/operators/models_llm.py:17
Method__init__
(self, config_path)
magic_pdf/model/custom_model.py:23
Method__init__
(self, model_path, dp=1, tp=1)
magic_pdf/model/custom_model.py:173
Method__init__
(self, model_path, tp=1)
magic_pdf/model/custom_model.py:213
Method__init__
(self, model_path: str, max_batch_size: int = 10, max_new_tokens=4096, device: str = None)
magic_pdf/model/custom_model.py:251
Method__init__
(self, url: str, model_name: str, api_key: str = None)
magic_pdf/model/custom_model.py:446
Method__init__
(self, model_path, dp=1, tp=1, max_batch_size=32, queue_timeout=0.1, max_queue_size=1000)
magic_pdf/model/custom_model.py:520
Method__init__
(self, model_path, tp=1, max_batch_size=64, queue_timeout=0.1, max_queue_size=1000)
magic_pdf/model/custom_model.py:885
Method__init__
(self)
magic_pdf/model/model_manager.py:21
← previousnext →201–300 of 485, ranked by callers