MCPcopy Create free account

hub / github.com/bytedance/Dolphin / functions

Functions50 in github.com/bytedance/Dolphin

↓ 6 callersMethodconvert
Convert recognition results to markdown format
utils/markdown_utils.py:308
↓ 4 callersFunctionprocess_element_batch
Process elements of the same type in batches
demo_page.py:289
↓ 4 callersFunctionresize_img
(image, max_size=1600, min_size=28)
utils/utils.py:434
↓ 3 callersFunctionparse_layout_string
Dolphin-V1.5 layout string parsing function Parse layout string to extract bbox and category information Supports multiple formats: 1
utils/utils.py:172
↓ 3 callersFunctionprocess_coordinates
(coords, pil_image)
utils/utils.py:204
↓ 3 callersFunctionsave_outputs
Save JSON and markdown outputs
utils/utils.py:234
↓ 2 callersMethod_handle_text
Process regular text content, preserving paragraph structure
utils/markdown_utils.py:162
↓ 2 callersMethodchat
(self, prompt, image)
demo_page.py:43
↓ 2 callersFunctionconvert_pdf_to_images
Convert PDF pages to images Args: pdf_path: Path to PDF file target_size: Target size for the longest dimension Returns:
utils/utils.py:55
↓ 2 callersFunctionprocess_single_image
Process a single image (either from file or converted from PDF page) Args: image: PIL Image object model: DOLPHIN model insta
demo_page.py:171
↓ 2 callersFunctionprocess_single_layout
Process layout for a single image Args: pil_image: PIL Image object model: DOLPHIN model instance save_dir: Directory
demo_layout.py:162
↓ 2 callersFunctionreplace_repeated_cdots
(latex)
utils/markdown_utils.py:47
↓ 2 callersFunctionsetup_output_dirs
Create necessary output directories
utils/utils.py:225
↓ 1 callersMethod_handle_figure
Handle figure content
utils/markdown_utils.py:240
↓ 1 callersMethod_handle_formula
Handle formula-specific content
utils/markdown_utils.py:286
↓ 1 callersMethod_handle_heading
Convert section headings to appropriate markdown format
utils/markdown_utils.py:215
↓ 1 callersMethod_handle_list_item
Convert list items to markdown list format
utils/markdown_utils.py:230
↓ 1 callersMethod_handle_table
Convert table content to markdown format
utils/markdown_utils.py:271
↓ 1 callersMethod_process_formulas_in_text
Process mathematical formulas in text by iteratively finding and replacing formulas. - Identify inline and block formulas - R
utils/markdown_utils.py:180
↓ 1 callersMethod_remove_newline_in_heading
Remove newline in heading
utils/markdown_utils.py:196
↓ 1 callersFunctionaligned_to_array
(latex: str)
utils/markdown_utils.py:29
↓ 1 callersFunctionassign_colors_to_elements
Assign colors to elements in order Args: num_elements: Number of elements to assign colors to Returns: List of c
utils/utils.py:415
↓ 1 callersFunctioncalculate_iou_matrix
Vectorized IoU matrix calculation [N, N] Args: boxes: List of bounding boxes in [x1, y1, x2, y2] format Returns:
utils/utils.py:461
↓ 1 callersMethodchat
(self, prompt, image)
demo_layout.py:43
↓ 1 callersMethodchat
(self, prompt, image)
demo_element.py:44
↓ 1 callersFunctioncheck_bbox_overlap
Check if bounding boxes have significant overlaps, indicating a distorted/photographed document If more than 60% of boxes have overlaps (IoU
utils/utils.py:489
↓ 1 callersFunctionextract_labels_from_string
from [202,217,921,325][para][author] extract para and author
utils/utils.py:158
↓ 1 callersFunctionextract_table_from_html
Extract and clean table tags from HTML string
utils/markdown_utils.py:11
↓ 1 callersFunctiongathered_to_aligned
(latex: str)
utils/markdown_utils.py:41
↓ 1 callersFunctionget_color_palette
Get a visually pleasing color palette for layout visualization Returns: List of BGR color tuples (semi-transparent, good for overlay)
utils/utils.py:382
↓ 1 callersFunctionmain
()
demo_layout.py:196
↓ 1 callersFunctionmain
()
demo_page.py:323
↓ 1 callersFunctionmain
()
demo_element.py:169
↓ 1 callersFunctionprocess_document
Parse documents with two stages - Handles both images and PDFs
demo_page.py:127
↓ 1 callersFunctionprocess_element
Process a single element image (text, table, formula) Args: image_path: Path to the element image model: HFModel model instan
demo_element.py:121
↓ 1 callersFunctionprocess_elements
Parse all document elements with parallel decoding
demo_page.py:201
↓ 1 callersFunctionprocess_layout
Process layout detection for image or PDF Args: input_path: Path to input image or PDF model: DOLPHIN model instance
demo_layout.py:128
↓ 1 callersFunctionremove_numeric_quad_ending
(s: str)
utils/markdown_utils.py:23
↓ 1 callersFunctionsave_combined_pdf_results
Save combined results for multi-page PDF with both JSON and Markdown Args: all_page_results: List of results for all pages pdf_pa
utils/utils.py:94
↓ 1 callersFunctionsave_figure_to_local
Save cropped figure to local file system Args: pil_crop: PIL Image object of the cropped figure save_dir: Base directory to save
utils/utils.py:22
↓ 1 callersFunctiontruncate_repeated_tail
(s, threshold=20, keep=1)
utils/markdown_utils.py:52
↓ 1 callersMethodtry_remove_newline
(self, text: str)
utils/markdown_utils.py:118
↓ 1 callersFunctionvisualize_layout
Visualize layout detection results on the image Args: image_path: Path to the input image layout_results: List of (bbox, labe
utils/utils.py:293
Method__init__
Initialize the Hugging Face model Args: model_id_or_path: Path to local model or Hugging Face model ID
demo_layout.py:19
Method__init__
Initialize the Hugging Face model Args: model_id_or_path: Path to local model or Hugging Face model ID
demo_page.py:19
Method__init__
Initialize the Hugging Face model Args: model_id_or_path: Path to local model or Hugging Face model ID
demo_element.py:20
Method__init__
(self, post_process: Optional[bool] = False)
utils/markdown_utils.py:85
Functioncrop_margin
Crop margins from image
utils/utils.py:257
Methodis_chinese
(char)
utils/markdown_utils.py:125
Functionrepl
(match)
utils/markdown_utils.py:32