Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Unified Toolkit for Deep Learning Based Document Image Analysis

License

NotificationsYou must be signed in to change notification settings

Layout-Parser/layout-parser

Repository files navigation

Layout Parser Logo

A unified toolkit for Deep Learning Based Document Image Analysis

Python 3.6 3.7 3.8PyPI - Downloads


Installation

You can find detailed installation instructions ininstallation.md. But generally, it's justpip installsome libraries:

pip install -U layoutparser# Install Detectron2 for using DL Layout Detection Model# Please make sure the PyTorch version is compatible with# the installed Detectron2 version.pip install'git+https://github.com/facebookresearch/detectron2.git@v0.4#egg=detectron2'# Install the ocr components when necessarypip install layoutparser[ocr]

For Windows Users: Please readinstallation.md for details about installing Detectron2.

Quick Start

We provide a series of examples for to help you start using the layout parser library:

  1. Table OCR and Results Parsing:layoutparser can be used for conveniently OCR documents and convert the output in to structured data.

  2. Deep Layout Parsing Example: With the help of Deep Learning,layoutparser supports the analysis very complex documents and processing of the hierarchical structure in the layouts.

DL Assisted Layout Prediction Example

Example Usage

The images shown in the figure above are: a screenshot ofthis paper, an image from thePRIMA Layout Analysis Dataset, a screenshot of theWSJ website, and an image from theHJDataset.

With only 4 lines of code inlayoutparse, you can unlock the information from complex documents that existing tools could not provide. You can either choose a deep learning model from theModelZoo, or load the model that you trained on your own. And use the following code to predict the layout as well as visualize it:

>>>importlayoutparseraslp>>>model=lp.Detectron2LayoutModel('lp://PrimaLayout/mask_rcnn_R_50_FPN_3x/config')>>>layout=model.detect(image)# You need to load the image somewhere else, e.g., image = cv2.imread(...)>>>lp.draw_box(image,layout,)# With extra configurations

Contributing

We encourage you to contribute to Ruby on Rails! Please check out theContributing guidelines for guidelines about how to proceed. Join us!

Citinglayoutparser

If you findlayoutparser helpful to your work, please consider citing our tool andpaper using the following BibTeX entry.

@article{shen2021layoutparser,  title={LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis},  author={Shen, Zejiang and Zhang, Ruochen and Dell, Melissa and Lee, Benjamin Charles Germain and Carlson, Jacob and Li, Weining},  journal={arXiv preprint arXiv:2103.15348},  year={2021}}

[8]ページ先頭

©2009-2025 Movatter.jp