Amazon Textract Overlay tools
Project description
Textract-Overlayer
amazon-textract-overlayer provides functions to help overlay bounding boxes on documents.
Install
> python -m pip install amazon-textract-overlayer
Make sure your environment is setup with AWS credentials through configuration files or environment variables or an attached role. (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
Samples
Primary method provided is get_bounding_boxes which returns bounding boxes based on the Textract_Type passed in.
Mostly taken from the amazon-textract
command from the package amazon-textract-helper
.
This will return the bounding boxes for WORD and CELL data types.
from textractoverlayer.t_overlay import DocumentDimensions, get_bounding_boxes
from textractcaller.t_call import Textract_Features, Textract_Types, call_textract
doc = call_textract(input_document=input_document, features=features)
# image is a PIL.Image.Image in this case
document_dimension:DocumentDimensions = DocumentDimensions(doc_width=image.size[0], doc_height=image.size[1])
overlay=[Textract_Types.WORD, Textract_Types.CELL]
bounding_box_list = get_bounding_boxes(textract_json=doc, document_dimensions=document_dimension, overlay_features=overlay)
The actual overlay drawing of bounding boxes for images is in the amazon-textract
command from the package amazon-textract-helper
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for amazon-textract-overlayer-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52baa0ca64672ac01e99d287bd2262ba8a64a5f9cb700e7ef0c22806fc409660 |
|
MD5 | e783acebce49dff0fef13ac8b2628d49 |
|
BLAKE2b-256 | fb9d8560cb9143b0c0c12a8d7860c9120f1167527e6559ece8c9d9039efbbe74 |
Hashes for amazon_textract_overlayer-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d987f08bc1f353c521b22d25c58c12a45bbde428bc9805fcc6f640d634e0c2 |
|
MD5 | faf714e159ade5d2ad31e7c03ac8b84b |
|
BLAKE2b-256 | 5d8112e9c0ad008a365f6b68c48beaeaae10bd5251b1f70bf6ca0f8cbf02cb6b |