skillfed

layoutparser

A unified toolkit for Deep Learning Based Document Image Analysis

layoutparser v0.3.4 1.2M downloads/30d#4,241 on PyPI5,770
Permissive license Apache-2.0 DORMANT released

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 on this page — 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

layoutparser on PyPI

pip

pip install layoutparser

uv

uv add layoutparser

poetry

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 the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 9 — numpy, opencv-python, scipy, pandas, pillow, pyyaml, iopath, pdfplumber, pdf2image
Maintenance dormant — 1,591 days since the last release
Last repo commit
First released
Downloads 1,190,511/month — #4,241 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: layoutparser-0.3.4-py3-none-any.whl

Keywords: layout analysis, deep learning

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

document layout detectiondeep learning document analysisOCR and layout parsingdocument image analysis toolkitlayout region extractionPDF document structure analysisdocument layout visualization
document-analysisocrlayout-detection

More Artificial Intelligence packages