Skip to main content

Unwarp documents

Project description

Docuwarp

Docuwarp is a Python library for unwarping documents. It uses for inference the model from the paper "UVDoc: Neural Grid-based Document Unwarping." For more information about the paper behind this model, you can read the paper here. The GitHub repository maintained by the author is available here.

Installation

To install Docuwarp, follow these steps:

For cpu

pip install "docuwarp[cpu]"

For cuda 11.X

pip install "docuwarp[gpu]"

For cuda 12.X

pip install "docuwarp[gpu]" --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/

Usage

Command Line Interface

You can use Docuwarp from the command line by providing an image file:

docuwarp examples/1.jpg

Using in Code

You can also incorporate Docuwarp into your Python code as follows:

from PIL import Image
from docuwarp.unwarp import Unwarp

unwarp = Unwarp()
image = Image.open('examples/1.jpg')
unwarped_image = unwarp.inference(image)

If you want to use CUDA:

from PIL import Image
from docuwarp.unwarp import Unwarp

unwarp = Unwarp(providers=["CUDAExecutionProvider"])
image = Image.open('examples/1.jpg')
unwarped_image = unwarp.inference(image)

Check all execution providers here.

Example

original unwarp

Citation

@inproceedings{UVDoc,
title={{UVDoc}: Neural Grid-based Document Unwarping},
author={Floor Verhoeven and Tanguy Magne and Olga Sorkine-Hornung},
booktitle = {SIGGRAPH ASIA, Technical Papers},
year = {2023},
url={https://doi.org/10.1145/3610548.3618174}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

docuwarp-1.0.2-py3-none-any.whl (14.8 MB view details)

Uploaded Python 3

File details

Details for the file docuwarp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: docuwarp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.16

File hashes

Hashes for docuwarp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da0d3838bb13b2fcf768919af94a0f1354321ae0a49e774cf5dde9f65bc0a5e9
MD5 9317361717e74ec3cbf5404fcc6bb634
BLAKE2b-256 bc33d8e2eb0474df899c634a04251eb36a903af07ea4869b2885731f8b4ea016

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page