{"id":15037422,"url":"https://github.com/layout-parser/layout-parser","last_synced_at":"2025-05-13T17:13:41.130Z","repository":{"id":38621107,"uuid":"271377309","full_name":"Layout-Parser/layout-parser","owner":"Layout-Parser","description":"A Unified Toolkit for Deep Learning Based Document Image Analysis","archived":false,"fork":false,"pushed_at":"2024-08-15T06:26:34.000Z","size":61152,"stargazers_count":5199,"open_issues_count":114,"forks_count":496,"subscribers_count":74,"default_branch":"main","last_synced_at":"2025-04-24T02:00:05.825Z","etag":null,"topics":["computer-vision","deep-learning","detectron2","document-image-processing","document-layout-analysis","layout-analysis","layout-detection","layout-parser","object-detection","ocr"],"latest_commit_sha":null,"homepage":"https://layout-parser.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Layout-Parser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-10T20:22:54.000Z","updated_at":"2025-04-23T19:17:11.000Z","dependencies_parsed_at":"2023-01-26T13:01:05.266Z","dependency_job_id":"b08c4669-48a0-4c8b-81d2-7da063919c9c","html_url":"https://github.com/Layout-Parser/layout-parser","commit_stats":{"total_commits":179,"total_committers":9,"mean_commits":19.88888888888889,"dds":0.06145251396648044,"last_synced_commit":"04e28168d820eea3a1ff1e098078323e7b48648b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layout-Parser%2Flayout-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layout-Parser%2Flayout-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layout-Parser%2Flayout-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layout-Parser%2Flayout-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Layout-Parser","download_url":"https://codeload.github.com/Layout-Parser/layout-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990498,"owners_count":21995776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","detectron2","document-image-processing","document-layout-analysis","layout-analysis","layout-detection","layout-parser","object-detection","ocr"],"created_at":"2024-09-24T20:34:36.489Z","updated_at":"2025-05-13T17:13:36.088Z","avatar_url":"https://github.com/Layout-Parser.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Layout-Parser/layout-parser/raw/main/.github/layout-parser.png\" alt=\"Layout Parser Logo\" width=\"35%\"\u003e\n  \u003ch3 align=\"center\"\u003e\n  A unified toolkit for Deep Learning Based Document Image Analysis\n  \u003c/h3\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e\n\u003ca href=\"https://pypi.org/project/layoutparser/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/layoutparser?color=%23099cec\u0026label=PyPI%20package\u0026logo=pypi\u0026logoColor=white\" title=\"The current version of Layout Parser\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Layout-Parser/layout-parser/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/pypi/l/layoutparser\" title=\"Layout Parser uses Apache 2 License\"\u003e\u003c/a\u003e\n\u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/layoutparser\"\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e\n\u003ca href=\"https://arxiv.org/abs/2103.15348\"\u003e\u003cimg src=\"https://img.shields.io/badge/paper-2103.15348-b31b1b.svg\" title=\"Layout Parser Paper\"\u003e\u003c/a\u003e\n\u003ca href=\"https://layout-parser.github.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/website-layout--parser.github.io-informational.svg\" title=\"Layout Parser Paper\"\u003e\u003c/a\u003e\n\u003ca href=\"https://layout-parser.readthedocs.io/en/latest/\"\u003e\u003cimg src=\"https://img.shields.io/badge/doc-layout--parser.readthedocs.io-light.svg\" title=\"Layout Parser Documentation\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## What is LayoutParser\n\n![Example Usage](https://github.com/Layout-Parser/layout-parser/raw/main/.github/example.png)\n\nLayoutParser aims to provide a wide range of tools that aims to streamline Document Image Analysis (DIA) tasks. Please check the LayoutParser [demo video](https://youtu.be/8yA5xB4Dg8c) (1 min) or [full talk](https://www.youtube.com/watch?v=YG0qepPgyGY) (15 min) for details. And here are some key features:\n\n- LayoutParser provides a rich repository of deep learning models for layout detection as well as a set of unified APIs for using them. For example, \n  \n  \u003cdetails\u003e\n  \u003csummary\u003ePerform DL layout detection in 4 lines of code\u003c/summary\u003e\n  \n  ```python\n  import layoutparser as lp\n  model = lp.AutoLayoutModel('lp://EfficientDete/PubLayNet')\n  # image = Image.open(\"path/to/image\")\n  layout = model.detect(image) \n  ```\n  \n  \u003c/details\u003e\n\n- LayoutParser comes with a set of layout data structures with carefully designed APIs that are optimized for document image analysis tasks. For example, \n\n  \u003cdetails\u003e\n  \u003csummary\u003eSelecting layout/textual elements in the left column of a page\u003c/summary\u003e\n  \n  ```python\n  image_width = image.size[0]\n  left_column = lp.Interval(0, image_width/2, axis='x')\n  layout.filter_by(left_column, center=True) # select objects in the left column \n  ```\n  \n  \u003c/details\u003e\n\n  \u003cdetails\u003e\n  \u003csummary\u003ePerforming OCR for each detected Layout Region\u003c/summary\u003e\n  \n  ```python\n  ocr_agent = lp.TesseractAgent()\n  for layout_region in layout: \n      image_segment = layout_region.crop(image)\n      text = ocr_agent.detect(image_segment)\n  ```\n  \n  \u003c/details\u003e  \n    \n  \u003cdetails\u003e\n  \u003csummary\u003eFlexible APIs for visualizing the detected layouts\u003c/summary\u003e\n  \n  ```python\n  lp.draw_box(image, layout, box_width=1, show_element_id=True, box_alpha=0.25)\n  ```\n  \n  \u003c/details\u003e  \n    \n  \u003c/details\u003e  \n    \n  \u003cdetails\u003e\n  \u003csummary\u003eLoading layout data stored in json, csv, and even PDFs\u003c/summary\u003e\n  \n  ```python \n  layout = lp.load_json(\"path/to/json\")\n  layout = lp.load_csv(\"path/to/csv\")\n  pdf_layout = lp.load_pdf(\"path/to/pdf\")\n  ```\n  \n  \u003c/details\u003e\n\n- LayoutParser is also a open platform that enables the sharing of layout detection models and DIA pipelines among the community. \n  \u003cdetails\u003e\n  \u003csummary\u003e\u003ca href=\"https://layout-parser.github.io/platform/\"\u003eCheck\u003c/a\u003e the LayoutParser open platform\u003c/summary\u003e\n  \u003c/details\u003e\n\n  \u003cdetails\u003e\n  \u003csummary\u003e\u003ca href=\"https://github.com/Layout-Parser/platform\"\u003eSubmit\u003c/a\u003e your models/pipelines to LayoutParser\u003c/summary\u003e\n  \u003c/details\u003e\n\n## Installation \n\nAfter several major updates, layoutparser provides various functionalities and deep learning models from different backends. But it still easy to install layoutparser, and we designed the installation method in a way such that you can choose to install only the needed dependencies for your project:\n\n```bash\npip install layoutparser # Install the base layoutparser library with  \npip install \"layoutparser[layoutmodels]\" # Install DL layout model toolkit \npip install \"layoutparser[ocr]\" # Install OCR toolkit\n```\n\nExtra steps are needed if you want to use Detectron2-based models. Please check [installation.md](installation.md) for additional details on layoutparser installation. \n\n## Examples \n\nWe provide a series of examples for to help you start using the layout parser library: \n\n1. [Table OCR and Results Parsing](https://github.com/Layout-Parser/layout-parser/blob/main/examples/OCR%20Tables%20and%20Parse%20the%20Output.ipynb): `layoutparser` can be used for conveniently OCR documents and convert the output in to structured data. \n\n2. [Deep Layout Parsing Example](https://github.com/Layout-Parser/layout-parser/blob/main/examples/Deep%20Layout%20Parsing.ipynb): With the help of Deep Learning, `layoutparser` supports the analysis very complex documents and processing of the hierarchical structure in the layouts. \n\n## Contributing\n\nWe encourage you to contribute to Layout Parser! Please check out the [Contributing guidelines](.github/CONTRIBUTING.md) for guidelines about how to proceed. Join us!\n\n## Citing `layoutparser`\n\nIf you find `layoutparser` helpful to your work, please consider citing our tool and [paper](https://arxiv.org/pdf/2103.15348.pdf) using the following BibTeX entry.\n\n```\n@article{shen2021layoutparser,\n  title={LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis},\n  author={Shen, Zejiang and Zhang, Ruochen and Dell, Melissa and Lee, Benjamin Charles Germain and Carlson, Jacob and Li, Weining},\n  journal={arXiv preprint arXiv:2103.15348},\n  year={2021}\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayout-parser%2Flayout-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayout-parser%2Flayout-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayout-parser%2Flayout-parser/lists"}