--- id: layoutparser version: "0.3.4" license: Apache-2.0 license_treatment: permissive maintenance: dormant --- # layoutparser — A unified toolkit for Deep Learning Based Document Image Analysis License: permissive · Maintenance: dormant · Downloads: 1.2M/mo ## What it is and what it does LayoutParser is a unified toolkit for document image analysis built on deep learning. It provides pre-trained models for detecting layout regions (text blocks, tables, figures) in document images and PDFs, along with specialized data structures and APIs for filtering, cropping, and analyzing those regions. The package integrates with OCR tools and supports loading layout data from JSON, CSV, and PDF files. Typical workflows involve loading an image, running a layout detection model to identify regions, filtering or cropping regions of interest, optionally running OCR on each region, and visualizing results. It's designed for tasks like table extraction, hierarchical document parsing, and structured data extraction from scanned or digital documents. The package depends on computer vision (opencv-python, pillow, scipy) and data handling (numpy, pandas, pyyaml) libraries, plus PDF-specific tools (pdfplumber, pdf2image). Use it for: - Extract tables from PDFs or scanned documents by detecting table regions and running OCR on each cell. - Analyze complex multi-column documents by filtering layout regions by spatial position (e.g., left column only). - Build document processing pipelines that detect and segment different content types (text, images, tables) for downstream processing. - Convert unstructured document images into structured data by detecting layout regions and extracting text via OCR. - Visualize document structure by drawing detected layout regions on images with element IDs and transparency. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. LayoutParser provides deep learning-based document layout detection and analysis, with APIs for detecting layout regions, filtering elements, performing OCR, and loading/visualizing document structures from images and PDFs. Yes, if you need document layout detection and are comfortable with a dormant package. LayoutParser has low install friction, permissive licensing, no known vulnerabilities, and strong community adoption. However, the last release was 2022-04-06—verify that its dependencies (especially opencv-python and deep learning model URLs) remain compatible with your environment before committing to production use. ## Install pip install layoutparser uv add layoutparser poetry add layoutparser ## Installing layoutparser Before you install: Low friction installation with a pure Python wheel and nine runtime dependencies (numpy, opencv-python, scipy, pandas, pillow, pyyaml, iopath, pdfplumber, pdf2image). Package is dormant—last release was 2022-04-06, over 1591 days ago, though the repository remains active with recent commits. License in practice: Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. No notable licensing constraints for most use cases. Quickstart: pip install layoutparser import layoutparser as lp model = lp.AutoLayoutModel('lp://EfficientDete/PubLayNet') layout = model.detect(image) Requires a pre-trained model URL or local model path; deep learning model downloads may be large and require network access on first use. Verify before relying: - Whether pre-trained models are automatically downloaded or must be manually configured. - Current compatibility with modern versions of opencv-python, scipy, and pandas given the 2022-04-06 release date. - Whether Detectron2 backend setup (mentioned in docs) is required for all layout detection tasks or only specific models. - Actual monthly download volume and PyPI ranking to confirm production-readiness despite dormant status. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags document layout detection, deep learning document analysis, OCR and layout parsing, document image analysis toolkit, layout region extraction, PDF document structure analysis, document layout visualization, document-analysis, ocr, layout-detection [View on SkillFed](https://skillfed.io/packages/layoutparser) · [View on PyPI](https://pypi.org/project/layoutparser/)