opendatalab/DocLayout-YOLO

DocLayout-YOLO: Enhancing Document Layout Analysis through Diverse Synthetic Data and Global-to-Local Adaptive Perception

What it solves

Documents come in many styles and layouts, and understanding where elements like titles, text blocks, tables, and figures sit on a page is essential for tasks like PDF extraction or document digitization. Existing models often struggle with variety and with elements of very different sizes. This project provides a fast and robust detector for that job.

How it works

Built on the YOLO-v10 object detection framework, the model is pre-trained on a synthetic dataset called DocSynth-300K, generated by a pipeline named Mesh-candidate BestFit. This pipeline composes realistic document pages by placing elements like text and images onto empty page backgrounds, treating the task like a 2D packing problem. The model also uses a special module designed to perceive both global structure and local details, helping it accurately detect elements that range from full-page tables to small captions. You can run predictions with a simple Python SDK or a demo script, and the project includes checkpoints fine-tuned on common benchmark datasets.

Who it's for

Developers building document processing pipelines, researchers studying layout analysis, or anyone who needs to automatically locate the components of a scanned or born-digital document. It is also used inside larger open-source projects like PDF-Extract-Kit and MinerU for content extraction.

Highlights

  • Online demo on Hugging Face Spaces for quick experimentation.
  • Pre-trained models ready for inference, plus checkpoints for D4LA and DocLayNet benchmarks.
  • A synthetic data generation pipeline (Mesh-candidate BestFit) that can create large, diverse training sets.
  • Integration with PDF-Extract-Kit and MinerU for end-to-end document parsing.
  • Simple installation via pip and both script-based and SDK-based prediction.

Related

  • Project
  • Project
  • Project
  • Project