Skip to main content

doc page extractor

English | 中文

Introduction

doc page extractor can identify text and format in images and return structured data.

Installation

pip install doc-page-extractor
pip install onnxruntime==1.21.0

Using CUDA

Please refer to the introduction of PyTorch and select the appropriate command to install according to your operating system.

In addition, replace the command to install onnxruntime in the previous article with the following:

pip install onnxruntime-gpu==1.21.0

Example

from PIL import Image
from doc_page_extractor import DocExtractor

extractor = DocExtractor(
  model_dir_path=model_path, # Folder address where AI model is downloaded and installed
  device="cpu", # If you want to use CUDA, please change to device="cuda".
)
with Image.open("/path/to/your/image.png") as image:
  result = extractor.extract(
  image=image,
  lang="ch", # Language of image text
)
for layout in result.layouts:
  for fragment in layout.fragments:
    print(fragment.rect, fragment.text)

Acknowledgements

The code of doc_page_extractor/onnxocr in this repo comes from OnnxOCR.

Metadata

Release files for doc-page-extractor-test 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doc-page-extractor-test 0.2.3
File Size Uploaded Provenance Actions
doc-page-extractor-test-0.2.3.tar.gz 62.3 kB Without provenance Details for doc-page-extractor-test-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for doc-page-extractor-test 0.2.3
File Interpreter ABI Platform Actions
doc_page_extractor_test-0.2.3-py3-none-any.whl Python 3 none any Details for doc_page_extractor_test-0.2.3-py3-none-any.whl

Total release size: 194.3 kB

Release files / doc-page-extractor-test-0.2.3.tar.gz

Download URL doc-page-extractor-test-0.2.3.tar.gz
Size 62.3 kB
Tags Source
SHA-256 checksum
How to use checksums
af7c7b26e0580f2c660329ab45b3a9405f5265a2a124f2c8a588cf36866178d7
BLAKE2b-256 checksum
How to use checksums
fd0500dcb91729257772fb21217f555db88f83643bc077d1b8a95e5d276d1605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / doc_page_extractor_test-0.2.3-py3-none-any.whl

Download URL doc_page_extractor_test-0.2.3-py3-none-any.whl
Size 132.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9dbc2cfc1e5d5c7e56836eac624131af482253e01aa8e6d9e695d6934f6e5750
BLAKE2b-256 checksum
How to use checksums
62245609a635a80421630a98f266550afe972f02cba4a11b6522baed53b7e1c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Security for doc-page-extractor-test 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page