Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Transforms Field to Bounding Boxes #295

Open
zkalson opened this issue Mar 31, 2024 · 0 comments
Open

Apply Transforms Field to Bounding Boxes #295

zkalson opened this issue Mar 31, 2024 · 0 comments
Assignees

Comments

@zkalson
Copy link

zkalson commented Mar 31, 2024

I understand that Document AI performs preprocessing to correct for issues like skew in documents sent to the API, and that any transformations applied are provided in the response under the transforms field. It would be massively helpful to have a function I can call on the Document object to the undo the preprocessing so that the bounding boxes are relative to the submitted document, not the preprocessed document.

I've spent a few weeks trying to implement this myself (and have a support request that's been in limbo for about a month and a half), and unfortunately haven't been able to make any progress. Admittedly, I have pretty limited experience with OpenCV, so I may be missing something.

Attached are images of a document I uploaded to GCP, the corresponding preprocessed image that GCP returns in the images field, and the output of the bounding boxes when I attempt to apply the transforms. If you look closely at the text layer, it doesn't match up with the original image.

original
gcp_preprocessed_image
output_text_layer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants